1.9 KiB
[projected]
24 Iterators library [iterators]
24.3 Iterator requirements [iterator.requirements]
24.3.6 Indirect callable requirements [indirectcallable]
24.3.6.4 Alias template projected [projected]
Alias template projected is used to constrain algorithms that accept callable objects and projections ([defns.projection]).
It combines an indirectly_readable type I and a callable object type Proj into a new indirectly_readable type whose reference type is the result of applyingProj to the iter_reference_t of I.
namespace std {template<class I, class Proj>struct projected-impl { // exposition onlystruct type { // exposition onlyusing value_type = remove_cvref_t<indirect_result_t<Proj&, I>>; using difference_type = iter_difference_t; // present only if I// models weakly_incrementable indirect_result_t<Proj&, I> operator*() const; // not defined}; }; template<indirectly_readable I, indirectly_regular_unary_invocable Proj>using projected = projected-impl<I, Proj>::type;}