nothrow-sentinel-for,nothrow-sized-sentinel-for
来自 zh.cppreference.net
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 起) (仅用于阐述*) |
这些仅用于阐述的概念指定,对于专用<内存>算法在迭代器和哨位之间的操作,不会抛出异常。
语义要求
1) 类型
S和I建模nothrow-sentinel-for仅当对于类型I和S的有效值,复制构造、移动构造、复制赋值、移动赋值或比较不会抛出异常时成立。2) 类型
S和I建模nothrow-sized-sentinel-for仅当对于类型-和I的有效值,S运算符不会抛出异常时成立。注解
这些概念允许某些sentinel_for和sized_sentinel_for操作抛出异常。
参阅
(C++20) |
指定一个类型是某个input_or_output_iterator类型的哨位 (概念) |
(C++20) |
指定-运算符可以应用于迭代器和哨位,以在常数时间内计算它们的差(概念) |