std::ranges::bidirectional_range
来自 cppreference.com
定义于头文件 <ranges> 中 |
||
template< class T > concept bidirectional_range = |
(自 C++20) | |
bidirectional_range
概念是 range
的细化,其中 ranges::begin 返回 bidirectional_iterator
的模型。
[编辑] 示例
运行此代码
#include <forward_list> #include <list> #include <ranges> #include <set> #include <unordered_set> int main() { static_assert( std::ranges::bidirectional_range<std::set<int>> and not std::ranges::bidirectional_range<std::unordered_set<int>> and std::ranges::bidirectional_range<std::list<int>> and not std::ranges::bidirectional_range<std::forward_list<int>> ); }
[编辑] 另请参见
(C++20) |
指定其迭代器类型满足 forward_iterator 的范围(概念) |
(C++20) |
指定其迭代器类型满足 random_access_iterator 的范围(概念) |