nothrow-sentinel-for, nothrow-sized-sentinel-for

来自cppreference.com


 
 
算法库


受约束算法及范围上的算法 (C++20)
包含算法例如 ranges::copyranges::sort、...
排序和相关操作
划分操作
排序操作
二分搜索操作(在已划分范围上)
集合操作(在有序范围上)
归并操作(在有序范围上)
堆操作
最小/最大操作
(C++11)
(C++17)
字典序比较操作
排列操作


 
 
template< class S, class I >
concept /*nothrow-sentinel-for*/ = std::sentinel_for<S, I>;
(1) (仅用于阐述*)
template< class I >
concept /*nothrow-sized-sentinel-for*/ =
    /*nothrow-sentinel-for*/<S, I> &&
    std::sized_sentinel_for<S, I>;
(2) (C++26 起)
(仅用于阐述*)

这些仅用于阐述的概念指定 <memory> 专门算法所要求的迭代器与哨位间的操作均不抛异常。

语义要求

1) 只有在 S 类型和 I 类型的复制构造、移动构造、复制赋值和移动复制操作以及 I 类型与 S 类型的有效值之间的比较操作都不会抛出异常时,类型 SI 才会实现 nothrow-sentinel-for
2) 只有在 I 类型与 S 类型的有效值之间的 - 运算不会抛出异常时,类型 SI 才会实现 nothrow-sized-sentinel-for

注解

这些概念允许部分 sentinel_forsized_sentinel_for 操作抛出异常。

参阅

指定类型为某个 input_or_output_iterator 类型的哨位类型
(概念) [编辑]
指定可对一个迭代器和一个哨位应用 - 运算符,以在常数时间计算其距离
(概念) [编辑]