# std::experimental::ranges::projected

< cpp‎ | experimental‎ | ranges

定义于头文件 `<experimental/ranges/iterator>` |  |
template <ranges::Readable I, ranges::IndirectRegularUnaryInvocable<I> Proj> struct projected { using value_type = std::remove_cv_t< std::remove_reference_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>; }; |  | (范围 TS)

类模板 `projected` 把 `Readable`类型 `I` 和函数 `Proj` 打包成新的可读 (`Readable`) 类型，其 `reference` 为应用 `Proj` 到 `I` 的 `reference` 类型的结果。它单独为简化制约规定而存在，故而其 operator*() 可以不实际定义。