breaking_changes.txt 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. Copyright (C) 2009 Sebastian Redl
  2. Distributed under the Boost Software License, Version 1.0.
  3. See http://www.boost.org/LICENSE_1_0.txt
  4. List all breaking changes done to the interface during the update here.
  5. - Template parameters
  6. Template parameters have been thoroughly changed.
  7. Impact: If you were using a custom instantiation of basic_ptree, you have to
  8. change your code.
  9. Rationale: The old order made no sense. It ordered the key comparison predicate
  10. before the key, although it could easily be defaulted based on it,
  11. and the path before the data type, when the path is something you
  12. will very rarely want to change (and it could default, too).
  13. - put*
  14. The put and put_child functions of basic_ptree had add and add_child split from
  15. them, by separating along the lines of the do_not_replace parameter.
  16. Impact: If you were using the third parameter of these functions, you have to
  17. change your code.
  18. Rationale: I'm not fond of using boolean parameters to change function behavior.
  19. They're hard to remember and hard to read in code. When projects
  20. adopt the convention of passing /*boolean=*/true,
  21. /*parameters=*/false, /*like=*/false this, something's wrong.
  22. It's even more wrong when the parameter has a negative name, as
  23. do_not_replace had.
  24. - Custom paths
  25. Custom paths have been thoroughly changed.
  26. Impact: If you were using custom paths, you have to change your code. If you
  27. referred to the basic_path template by name, you have to change your
  28. code.
  29. Rationale: The old interface required a huge amount of repeated code for
  30. custom paths. The new interface is a lot easier to implement.
  31. - Translators
  32. Translators have been thoroughly changed.
  33. Impact: If you were using translators at all, you probably have to change your
  34. code.
  35. Rationale: The new interface makes it easier to pass custom translators to
  36. specific get/put operations. It also keeps the translator out of
  37. the tree's type.
  38. - find
  39. find() returns an assoc_iterator.
  40. Impact: If you use find, you may have to change your code. Most importantly,
  41. you need to compare against not_found() instead of end().
  42. Rationale: equal_range() also returns assoc_iterators. equal_range() cannot
  43. return normal iterators, since the conversion would not preserve
  44. the equal range or even the range property.