std::indirect_binary_predicate
来自cppreference.com
迭代器库
| 迭代器概念 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 迭代器原语 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 算法概念与工具 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 间接可调用概念 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 常用算法要求 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 工具 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 迭代器适配器 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 在标头 <iterator> 定义
|
||
template< class F, class I1, class I2 >
concept indirect_binary_predicate =
std::indirectly_readable<I1> &&
std::indirectly_readable<I2> &&
std::copy_constructible<F> &&
std::predicate<F&, /*indirect-value-t*/<I1>, /*indirect-value-t*/<I2>> &&
std::predicate<F&, /*indirect-value-t*/<I1>, std::iter_reference_t<I2>> &&
std::predicate<F&, std::iter_reference_t<I1>, /*indirect-value-t*/<I2>> &&
std::predicate<F&, std::iter_reference_t<I1>, std::iter_reference_t<I2>>;
|
(C++20 起) | |
概念 indirect_binary_predicate 指定对于“调用作为它的实参的二元谓词的算法”的要求。此概念与 std::predicate 的关键区别是它被应用到 I1 与 I2 所引用的类型,而非 I1 与 I2 自身。
缺陷报告
下列更改行为的缺陷报告追溯地应用于以前出版的 C++ 标准。
| 缺陷报告 | 应用于 | 出版时的行为 | 正确行为 |
|---|---|---|---|
| P2609R3 | C++20 | 一些要求是基于 std::iter_value_t<I>& 定义的但它未能正确处理一些投影而导致与可调用的 F& 不兼容
|
基于 /*indirect-value-t*/<I> 定义以正确处理这些投影
|
| P2997R1 | C++20 | 对应的概念分别要求 F& 满足 invocable 和regular_invocable 以及 std::iter_common_reference_t<I>
|
不作此要求 |
