tmp/tmpoi7e35x_/{from.md → to.md}
RENAMED
|
@@ -1,52 +1,51 @@
|
|
| 1 |
-
###
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 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 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 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 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 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 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 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 |
|