tmp/tmpommv3ug5/{from.md → to.md}
RENAMED
|
@@ -1,23 +1,25 @@
|
|
| 1 |
-
####
|
| 2 |
|
| 3 |
-
|
| 4 |
callable objects and projections [[defns.projection]]. It combines an
|
| 5 |
`indirectly_readable` type `I` and a callable object type `Proj` into a
|
| 6 |
new `indirectly_readable` type whose `reference` type is the result of
|
| 7 |
applying `Proj` to the `iter_reference_t` of `I`.
|
| 8 |
|
| 9 |
``` cpp
|
| 10 |
namespace std {
|
| 11 |
-
template<
|
| 12 |
-
struct projected {
|
|
|
|
| 13 |
using value_type = remove_cvref_t<indirect_result_t<Proj&, I>>;
|
|
|
|
|
|
|
| 14 |
indirect_result_t<Proj&, I> operator*() const; // not defined
|
| 15 |
};
|
| 16 |
-
|
| 17 |
-
template<weakly_incrementable I, class Proj>
|
| 18 |
-
struct incrementable_traits<projected<I, Proj>> {
|
| 19 |
-
using difference_type = iter_difference_t<I>;
|
| 20 |
};
|
|
|
|
|
|
|
|
|
|
| 21 |
}
|
| 22 |
```
|
| 23 |
|
|
|
|
| 1 |
+
#### Alias template `projected` <a id="projected">[[projected]]</a>
|
| 2 |
|
| 3 |
+
Alias template `projected` is used to constrain algorithms that accept
|
| 4 |
callable objects and projections [[defns.projection]]. It combines an
|
| 5 |
`indirectly_readable` type `I` and a callable object type `Proj` into a
|
| 6 |
new `indirectly_readable` type whose `reference` type is the result of
|
| 7 |
applying `Proj` to the `iter_reference_t` of `I`.
|
| 8 |
|
| 9 |
``` cpp
|
| 10 |
namespace std {
|
| 11 |
+
template<class I, class Proj>
|
| 12 |
+
struct projected-impl { // exposition only
|
| 13 |
+
struct type { // exposition only
|
| 14 |
using value_type = remove_cvref_t<indirect_result_t<Proj&, I>>;
|
| 15 |
+
using difference_type = iter_difference_t<I>; // present only if I
|
| 16 |
+
// models weakly_incrementable
|
| 17 |
indirect_result_t<Proj&, I> operator*() const; // not defined
|
| 18 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
};
|
| 20 |
+
|
| 21 |
+
template<indirectly_readable I, indirectly_regular_unary_invocable<I> Proj>
|
| 22 |
+
using projected = projected-impl<I, Proj>::type;
|
| 23 |
}
|
| 24 |
```
|
| 25 |
|