tmp/tmp6ptykesn/{from.md → to.md}
RENAMED
|
@@ -32,21 +32,22 @@ the following manner:
|
|
| 32 |
``` cpp
|
| 33 |
C(ranges::begin(r), ranges::end(r), std::forward<Args>(args)...)
|
| 34 |
```
|
| 35 |
- Otherwise, if
|
| 36 |
- `constructible_from<C, Args...>` is `true`, and
|
| 37 |
-
- *`container-
|
| 38 |
|
| 39 |
``` cpp
|
| 40 |
C c(std::forward<Args>(args)...);
|
| 41 |
-
if constexpr (
|
| 42 |
-
c.reserve(static_cast<range_size_t<C>>(ranges::
|
| 43 |
-
ranges::
|
| 44 |
```
|
|
|
|
| 45 |
- Otherwise, if `input_range<range_reference_t<R>>` is `true`:
|
| 46 |
``` cpp
|
| 47 |
-
to<C>(r | views::transform([](auto&& elem) {
|
| 48 |
return to<range_value_t<C>>(std::forward<decltype(elem)>(elem));
|
| 49 |
}), std::forward<Args>(args)...);
|
| 50 |
```
|
| 51 |
- Otherwise, the program is ill-formed.
|
| 52 |
|
|
|
|
| 32 |
``` cpp
|
| 33 |
C(ranges::begin(r), ranges::end(r), std::forward<Args>(args)...)
|
| 34 |
```
|
| 35 |
- Otherwise, if
|
| 36 |
- `constructible_from<C, Args...>` is `true`, and
|
| 37 |
+
- *`container-appendable`*`<C, range_reference_t<R>>` is `true`:
|
| 38 |
|
| 39 |
``` cpp
|
| 40 |
C c(std::forward<Args>(args)...);
|
| 41 |
+
if constexpr (approximately_sized_range<R> && reservable-container<C>)
|
| 42 |
+
c.reserve(static_cast<range_size_t<C>>(ranges::reserve_hint(r)));
|
| 43 |
+
ranges::for_each(r, container-append(c));
|
| 44 |
```
|
| 45 |
+
- Otherwise, the program is ill-formed.
|
| 46 |
- Otherwise, if `input_range<range_reference_t<R>>` is `true`:
|
| 47 |
``` cpp
|
| 48 |
+
to<C>(ref_view(r) | views::transform([](auto&& elem) {
|
| 49 |
return to<range_value_t<C>>(std::forward<decltype(elem)>(elem));
|
| 50 |
}), std::forward<Args>(args)...);
|
| 51 |
```
|
| 52 |
- Otherwise, the program is ill-formed.
|
| 53 |
|