nothrow-input-range, nothrow-forward-range, nothrow-bidirectional-range, no-throw-input-range, nothrow-random-access-range, nothrow-sized-random-access-range
来自 zh.cppreference.net
template< class R >
concept /*nothrow-input-range*/ =
ranges::range<R> &&
/*nothrow-input-iterator*/<ranges::iterator_t<R>> &&
/*nothrow-sentinel-for*/<ranges::sentinel_t<R>, ranges::iterator_t<R>>;
|
(1) | (仅用于描述*) |
template< class R >
concept /*nothrow-forward-range*/ =
/*nothrow-input-range*/<R> &&
/*nothrow-forward-iterator*/<ranges::iterator_t<R>>;
|
(2) | (仅用于描述*) |
template< class R >
concept /*nothrow-bidirectional-range*/ =
/*nothrow-forward-range*/<R> &&
/*nothrow-bidirectional-iterator*/<ranges::iterator_t<R>>;
|
(3) | (自 C++26 起) (仅用于描述*) |
template< class R >
concept /*nothrow-random-access-range*/ =
/*nothrow-bidirectional-range*/<R> &&
/*nothrow-random-access-iterator*/<ranges::iterator_t<R>>;
|
(4) | (自 C++26 起) (仅用于描述*) |
template< class R >
concept /*nothrow-sized-random-access-range*/ =
/*nothrow-random-access-range*/<R> && ranges::sized_range<R>;
|
(5) | (自 C++26 起) (仅用于描述*) |
这些仅用于描述的概念指定,在范围上由专用 <内存> 算法所需的操作不会抛出异常。
关于 /*nothrow-input-iterator*/, /*nothrow-forward-iterator*/, /*nothrow-bidirectional-iterator*/ 和 /*nothrow-random-access-iterator*/ 的定义,请参见 此页面.
语义要求
注解
这些概念允许某些范围上的操作抛出异常。
参阅
(C++20) |
指定一个类型是一个范围,即它提供 begin 迭代器 和 end 哨位 (概念) |
(C++20) |
指定一个范围在常数时间内知道其大小 (概念) |
(C++20)(C++23)(C++20)(C++23) |
获取范围的迭代器和哨位类型 (别名模板) |