std::projected
来自cppreference.com
| 定义于头文件 <iterator>
|
||
| template< std::indirectly_readable I, std::indirectly_regular_unary_invocable<I> Proj > |
(1) | (C++20 起) |
| template< std::weakly_incrementable I, class Proj > struct incrementable_traits<std::projected<I, Proj>> { |
(2) | (C++20 起) |
1) 类模板
projected 组合 indirectly_readable 类型 I 与可调用对象类型 Proj 到新的 indirectly_readable 类型中,其引用类型是应用 Proj 到 std::iter_reference_t<I> 的结果。2) std::incrementable_traits 的此特化使 std::projected<I, Proj> 在
I 为 weakly_incrementable 类型时亦为 weakly_incrementable 类型。projected 仅用于制约接受可调用对象与投影的算法,从而其 operator*() 不被定义。
模板形参
| I | - | 间接可读类型 |
| Proj | - | 应用到解引用的 I 的投影
|