From Jason Turner

[diff.cpp03.containers]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpoi7e35x_/{from.md → to.md} +33 -35
tmp/tmpoi7e35x_/{from.md → to.md} RENAMED
@@ -1,52 +1,51 @@
1
- ### Clause [[containers]]: containers library <a id="diff.cpp03.containers">[[diff.cpp03.containers]]</a>
2
 
3
- [[container.requirements]] **Change:** Complexity of `size()` member
4
- functions now constant. **Rationale:** Lack of specification of
5
- complexity of `size()` resulted in divergent implementations with
6
- inconsistent performance characteristics. **Effect on original
7
- feature:** Some container implementations that conform to C++03may not
8
- conform to the specified `size()` requirements in this International
9
- Standard. Adjusting containers such as `std::list` to the stricter
10
- requirements may require incompatible changes.
11
 
12
- [[container.requirements]] **Change:** Requirements change: relaxation.
13
- **Rationale:** Clarification. **Effect on original feature:** Valid
14
- C++03code that attempts to meet the specified container requirements may
15
- now be over-specified. Code that attempted to be portable across
16
- containers may need to be adjusted as follows:
17
 
18
  - not all containers provide `size()`; use `empty()` instead of
19
  `size() == 0`;
20
  - not all containers are empty after construction (`array`);
21
  - not all containers have constant complexity for `swap()` (`array`).
22
 
23
- [[container.requirements]] **Change:** Requirements change: default
24
- constructible. **Rationale:** Clarification of container requirements.
25
- **Effect on original feature:** Valid C++03code that attempts to
26
- explicitly instantiate a container using a user-defined type with no
27
- default constructor may fail to compile.
28
 
29
- [[sequence.reqmts]], [[associative.reqmts]] **Change:** Signature
30
- changes: from `void` return types. **Rationale:** Old signature threw
31
- away useful information that may be expensive to recalculate. **Effect
32
- on original feature:** The following member functions have changed:
33
 
34
  - `erase(iter)` for `set`, `multiset`, `map`, `multimap`
35
  - `erase(begin, end)` for `set`, `multiset`, `map`, `multimap`
36
  - `insert(pos, num, val)` for `vector`, `deque`, `list`, `forward_list`
37
  - `insert(pos, beg, end)` for `vector`, `deque`, `list`, `forward_list`
38
 
39
  Valid C++03 code that relies on these functions returning `void` (e.g.,
40
  code that creates a pointer to member function that points to one of
41
  these functions) will fail to compile with this International Standard.
42
 
43
- [[sequence.reqmts]], [[associative.reqmts]] **Change:** Signature
44
- changes: from `iterator` to `const_iterator` parameters. **Rationale:**
45
- Overspecification. **Effect on original feature:** The signatures of the
46
- following member functions changed from taking an `iterator` to taking a
47
- `const_iterator`:
48
 
49
  - `insert(iter, val)` for `vector`, `deque`, `list`, `set`, `multiset`,
50
  `map`, `multimap`
51
  - `insert(pos, beg, end)` for `vector`, `deque`, `list`, `forward_list`
52
  - `erase(begin, end)` for `set`, `multiset`, `map`, `multimap`
@@ -54,13 +53,12 @@ following member functions changed from taking an `iterator` to taking a
54
  - all forms of `list::merge`
55
 
56
  Valid C++03 code that uses these functions may fail to compile with this
57
  International Standard.
58
 
59
- [[sequence.reqmts]], [[associative.reqmts]] **Change:** Signature
60
- changes: `resize`. **Rationale:** Performance, compatibility with move
61
- semantics. **Effect on original feature:** For `vector`, `deque`, and
62
- `list` the fill value passed to `resize` is now passed by reference
63
- instead of by value, and an additional overload of `resize` has been
64
- added. Valid C++03code that uses this function may fail to compile with
65
- this International Standard.
66
 
 
1
+ ### [[containers]]: containers library <a id="diff.cpp03.containers">[[diff.cpp03.containers]]</a>
2
 
3
+ **Change:** Complexity of `size()` member functions now constant.
4
+ **Rationale:** Lack of specification of complexity of `size()` resulted
5
+ in divergent implementations with inconsistent performance
6
+ characteristics. **Effect on original feature:** Some container
7
+ implementations that conform to C++03 may not conform to the specified
8
+ `size()` requirements in this International Standard. Adjusting
9
+ containers such as `std::list` to the stricter requirements may require
10
+ incompatible changes.
11
 
12
+ **Change:** Requirements change: relaxation. **Rationale:**
13
+ Clarification. **Effect on original feature:** Valid C++03 code that
14
+ attempts to meet the specified container requirements may now be
15
+ over-specified. Code that attempted to be portable across containers may
16
+ need to be adjusted as follows:
17
 
18
  - not all containers provide `size()`; use `empty()` instead of
19
  `size() == 0`;
20
  - not all containers are empty after construction (`array`);
21
  - not all containers have constant complexity for `swap()` (`array`).
22
 
23
+ **Change:** Requirements change: default constructible. **Rationale:**
24
+ Clarification of container requirements. **Effect on original feature:**
25
+ Valid C++03 code that attempts to explicitly instantiate a container
26
+ using a user-defined type with no default constructor may fail to
27
+ compile.
28
 
29
+ **Change:** Signature changes: from `void` return types. **Rationale:**
30
+ Old signature threw away useful information that may be expensive to
31
+ recalculate. **Effect on original feature:** The following member
32
+ functions have changed:
33
 
34
  - `erase(iter)` for `set`, `multiset`, `map`, `multimap`
35
  - `erase(begin, end)` for `set`, `multiset`, `map`, `multimap`
36
  - `insert(pos, num, val)` for `vector`, `deque`, `list`, `forward_list`
37
  - `insert(pos, beg, end)` for `vector`, `deque`, `list`, `forward_list`
38
 
39
  Valid C++03 code that relies on these functions returning `void` (e.g.,
40
  code that creates a pointer to member function that points to one of
41
  these functions) will fail to compile with this International Standard.
42
 
43
+ **Change:** Signature changes: from `iterator` to `const_iterator`
44
+ parameters. **Rationale:** Overspecification. **Effect on original
45
+ feature:** The signatures of the following member functions changed from
46
+ taking an `iterator` to taking a `const_iterator`:
 
47
 
48
  - `insert(iter, val)` for `vector`, `deque`, `list`, `set`, `multiset`,
49
  `map`, `multimap`
50
  - `insert(pos, beg, end)` for `vector`, `deque`, `list`, `forward_list`
51
  - `erase(begin, end)` for `set`, `multiset`, `map`, `multimap`
 
53
  - all forms of `list::merge`
54
 
55
  Valid C++03 code that uses these functions may fail to compile with this
56
  International Standard.
57
 
58
+ **Change:** Signature changes: `resize`. **Rationale:** Performance,
59
+ compatibility with move semantics. **Effect on original feature:** For
60
+ `vector`, `deque`, and `list` the fill value passed to `resize` is now
61
+ passed by reference instead of by value, and an additional overload of
62
+ `resize` has been added. Valid C++03 code that uses this function may
63
+ fail to compile with this International Standard.
 
64