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 (概念) |