tmp/tmphtoc_v9x/{from.md → to.md}
RENAMED
|
@@ -29,28 +29,36 @@ constexpr bool reservable-container = // exposition only
|
|
| 29 |
{ c.capacity() } -> same_as<decltype(n)>;
|
| 30 |
{ c.max_size() } -> same_as<decltype(n)>;
|
| 31 |
};
|
| 32 |
```
|
| 33 |
|
| 34 |
-
Let *`container-
|
| 35 |
|
| 36 |
``` cpp
|
| 37 |
template<class Container, class Ref>
|
| 38 |
-
constexpr bool container-
|
| 39 |
requires(Container& c, Ref&& ref) {
|
| 40 |
-
requires (requires { c.
|
|
|
|
|
|
|
| 41 |
requires { c.insert(c.end(), std::forward<Ref>(ref)); });
|
| 42 |
};
|
| 43 |
```
|
| 44 |
|
| 45 |
-
Let *`container-
|
| 46 |
|
| 47 |
``` cpp
|
| 48 |
-
template<class
|
| 49 |
-
constexpr auto container-
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
else
|
| 53 |
-
|
|
|
|
| 54 |
}
|
| 55 |
```
|
| 56 |
|
|
|
|
| 29 |
{ c.capacity() } -> same_as<decltype(n)>;
|
| 30 |
{ c.max_size() } -> same_as<decltype(n)>;
|
| 31 |
};
|
| 32 |
```
|
| 33 |
|
| 34 |
+
Let *`container-appendable`* be defined as follows:
|
| 35 |
|
| 36 |
``` cpp
|
| 37 |
template<class Container, class Ref>
|
| 38 |
+
constexpr bool container-appendable = // exposition only
|
| 39 |
requires(Container& c, Ref&& ref) {
|
| 40 |
+
requires (requires { c.emplace_back(std::forward<Ref>(ref)); } ||
|
| 41 |
+
requires { c.push_back(std::forward<Ref>(ref)); } ||
|
| 42 |
+
requires { c.emplace(c.end(), std::forward<Ref>(ref)); } ||
|
| 43 |
requires { c.insert(c.end(), std::forward<Ref>(ref)); });
|
| 44 |
};
|
| 45 |
```
|
| 46 |
|
| 47 |
+
Let *`container-append`* be defined as follows:
|
| 48 |
|
| 49 |
``` cpp
|
| 50 |
+
template<class Container>
|
| 51 |
+
constexpr auto container-append(Container& c) { // exposition only
|
| 52 |
+
return [&c]<class Ref>(Ref&& ref) {
|
| 53 |
+
if constexpr (requires { c.emplace_back(declval<Ref>()); })
|
| 54 |
+
c.emplace_back(std::forward<Ref>(ref));
|
| 55 |
+
else if constexpr (requires { c.push_back(declval<Ref>()); })
|
| 56 |
+
c.push_back(std::forward<Ref>(ref));
|
| 57 |
+
else if constexpr (requires { c.emplace(c.end(), declval<Ref>()); })
|
| 58 |
+
c.emplace(c.end(), std::forward<Ref>(ref));
|
| 59 |
else
|
| 60 |
+
c.insert(c.end(), std::forward<Ref>(ref));
|
| 61 |
+
};
|
| 62 |
}
|
| 63 |
```
|
| 64 |
|