tmp/tmp7rhi2fv5/{from.md → to.md}
RENAMED
|
@@ -1,20 +1,23 @@
|
|
| 1 |
### [[containers]]: containers library <a id="diff.cpp20.containers">[[diff.cpp20.containers]]</a>
|
| 2 |
|
| 3 |
**Change:** Heterogeneous `extract` and `erase` overloads for
|
| 4 |
associative containers. **Rationale:** Improve efficiency of erasing
|
| 5 |
elements from associative containers. **Effect on original feature:**
|
| 6 |
-
Valid C++20 code may fail to compile in this revision of C++.
|
| 7 |
-
|
|
|
|
| 8 |
|
| 9 |
``` cpp
|
| 10 |
struct B {
|
| 11 |
auto operator<=>(const B&) const = default;
|
| 12 |
};
|
| 13 |
|
| 14 |
struct D : private B {
|
| 15 |
void f(std::set<B, std::less<>>& s) {
|
| 16 |
-
s.erase(*this); // ill
|
| 17 |
}
|
| 18 |
};
|
| 19 |
```
|
| 20 |
|
|
|
|
|
|
|
|
|
| 1 |
### [[containers]]: containers library <a id="diff.cpp20.containers">[[diff.cpp20.containers]]</a>
|
| 2 |
|
| 3 |
**Change:** Heterogeneous `extract` and `erase` overloads for
|
| 4 |
associative containers. **Rationale:** Improve efficiency of erasing
|
| 5 |
elements from associative containers. **Effect on original feature:**
|
| 6 |
+
Valid C++20 code may fail to compile in this revision of C++.
|
| 7 |
+
|
| 8 |
+
[*Example 1*:
|
| 9 |
|
| 10 |
``` cpp
|
| 11 |
struct B {
|
| 12 |
auto operator<=>(const B&) const = default;
|
| 13 |
};
|
| 14 |
|
| 15 |
struct D : private B {
|
| 16 |
void f(std::set<B, std::less<>>& s) {
|
| 17 |
+
s.erase(*this); // ill-formed; previously well-formed
|
| 18 |
}
|
| 19 |
};
|
| 20 |
```
|
| 21 |
|
| 22 |
+
— *end example*]
|
| 23 |
+
|