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