std::experimental::ranges::projected - cppreference.com

##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::experimental::ranges::projected

From cppreference.com
< cpp‎ | experimental‎ | ranges

Defined in header `<experimental/ranges/iterator>` |  |
template <ranges::Readable I, ranges::IndirectRegularInvocable<I> Proj> struct projected { using value_type = std::decay_t<ranges::indirect_result_of_t<Proj&(I)>>; ranges::indirect_result_of_t<Proj&(I)> operator*() const; }; template <ranges::WeaklyIncrementable I, class Proj> struct difference_type<projected<I, Proj>> { using type = ranges::difference_type_t<I>; }; |  |

The class template `projected` bundles a `Readable` type `I` and a function `Proj` into a new `Readable` type whose `reference` type is the result of applying `Proj` to the `reference` type of `I`. It exists solely to ease constraint specification, and so its operator*() may not be actually defined.

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/experimental/ranges/iterator/projected&oldid=89780"