std::projected
Defined in header <iterator>
|
||
(1) | ||
template< std::indirectly_readable I, std::indirectly_regular_unary_invocable<I> Proj > |
(since C++20) (until C++26) |
|
template< std::indirectly_readable I, std::indirectly_regular_unary_invocable<I> Proj > |
(since C++26) | |
template< std::weakly_incrementable I, class Proj > struct incrementable_traits<std::projected<I, Proj>> { |
(2) | (since C++20) (until C++26) |
template< class I, class Proj > struct /*projected-impl*/ { // exposition only |
(3) | (since C++26) |
projected
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 applying Proj
to the std::iter_reference_t<I>.weakly_incrementable
type when I
is also a weakly_incrementable
type.difference_type
exists only if I
models weakly_incrementable
.projected
is used only to constrain algorithms that accept callable objects and projections, and hence its operator*() is not defined.
Template parameters
I | - | an indirectly readable type |
Proj | - | projection applied to a dereferenced I
|
Notes
The indirect layer prevents I
and Proj
to be associated classes of projected
. When an associated class of I
or Proj
is an incomplete class type, the indirect layer avoids the unnecessary attempt to inspect the definition of that type that results in hard error.