25 lines
1.9 KiB
Markdown
25 lines
1.9 KiB
Markdown
[projected]
|
||
|
||
# 24 Iterators library [[iterators]](./#iterators)
|
||
|
||
## 24.3 Iterator requirements [[iterator.requirements]](iterator.requirements#projected)
|
||
|
||
### 24.3.6 Indirect callable requirements [[indirectcallable]](indirectcallable#projected)
|
||
|
||
#### 24.3.6.4 Alias template projected [projected]
|
||
|
||
[1](#1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/iterators.tex#L2515)
|
||
|
||
Alias template projected is used to constrain algorithms
|
||
that accept callable objects and projections ([[defns.projection]](defns.projection "3.44 projection"))[.](#1.sentence-1)
|
||
|
||
It combines an [indirectly_readable](iterator.concept.readable#concept:indirectly_readable "24.3.4.2 Concept indirectly_readable [iterator.concept.readable]") type I and
|
||
a callable object type Proj into a new [indirectly_readable](iterator.concept.readable#concept:indirectly_readable "24.3.4.2 Concept indirectly_readable [iterator.concept.readable]") type
|
||
whose reference type is the result of applyingProj to the iter_reference_t of I[.](#1.sentence-2)
|
||
|
||
[ð](#lib:projected)
|
||
|
||
namespace std {template<class I, class Proj>struct *projected-impl* { // *exposition only*struct *type* { // *exposition only*using value_type = remove_cvref_t<indirect_result_t<Proj&, I>>; using difference_type = iter_difference_t<I>; // present only if I// models [weakly_incrementable](iterator.concept.winc#concept:weakly_incrementable "24.3.4.4 Concept weakly_incrementable [iterator.concept.winc]") indirect_result_t<Proj&, I> operator*() const; // *not defined*}; }; template<[indirectly_readable](iterator.concept.readable#concept:indirectly_readable "24.3.4.2 Concept indirectly_readable [iterator.concept.readable]") I, [indirectly_regular_unary_invocable](indirectcallable.indirectinvocable#concept:indirectly_regular_unary_invocable "24.3.6.3 Indirect callables [indirectcallable.indirectinvocable]")<I> Proj>using projected = *projected-impl*<I, Proj>::*type*;}
|