标准库头文件 <experimental/ranges/range>
来自 cppreference.cn
此头文件是 ranges 库的一部分。
目录 |
[编辑] Range 概念
定义于命名空间
std::experimental::ranges | |
指定类型为范围,即它提供 begin 迭代器和 end 哨兵(概念) | |
指定范围在常数时间内知道其大小 (概念) | |
指定范围是视图,即它具有常数时间复制/移动/赋值 (概念) | |
指定范围具有相同的迭代器和哨兵类型 (概念) | |
指定其迭代器类型满足 InputIterator 的 Range(概念) | |
指定其迭代器类型满足 OutputIterator 的 Range(概念) | |
指定其迭代器类型满足 ForwardIterator 的 Range(概念) | |
指定其迭代器类型满足 BidirectionalIterator 的 Range(概念) | |
指定其迭代器类型满足 RandomAccessIterator 的 Range(概念) |
[编辑] Range 访问
定义于命名空间
std::experimental::ranges | |
返回指向范围开头的迭代器 (定制点对象) | |
返回指向 Range 末尾的迭代器 (定制点对象) | |
返回指向范围的反向迭代器 (定制点对象) | |
返回指向范围的反向结束迭代器 (定制点对象) |
[编辑] Range 原语
定义于命名空间
std::experimental::ranges | |
获取在常数时间内可计算大小的范围的大小 (定制点对象) | |
检查范围是否为空 (定制点对象) | |
获取指向连续范围开头的指针 (定制点对象) | |
获取 Range 的迭代器和哨兵类型 (别名模板) |
[编辑] 概要
#include <experimental/ranges/iterator> namespace std { namespace experimental { namespace ranges { inline namespace v1 { namespace { constexpr /* unspecified */ begin = /* unspecified */; constexpr /* unspecified */ end = /* unspecified */; constexpr /* unspecified */ cbegin = /* unspecified */; constexpr /* unspecified */ cend = /* unspecified */; constexpr /* unspecified */ rbegin = /* unspecified */; constexpr /* unspecified */ rend = /* unspecified */; constexpr /* unspecified */ crbegin = /* unspecified */; constexpr /* unspecified */ crend = /* unspecified */; } namespace { constexpr /* unspecified */ size = /* unspecified */; constexpr /* unspecified */ empty = /* unspecified */; constexpr /* unspecified */ data = /* unspecified */; constexpr /* unspecified */ cdata = /* unspecified */; } template <class T> using iterator_t = decltype(ranges::begin(declval<T&>())); template <class T> using sentinel_t = decltype(ranges::end(declval<T&>())); template <class> constexpr bool disable_sized_range = false; template <class T> struct enable_view { }; struct view_base { }; template <class T> concept bool Range = /* see definition */; template <class T> concept bool SizedRange = /* see definition */; template <class T> concept bool View = /* see definition */; template <class T> concept bool BoundedRange = /* see definition */; template <class T> concept bool InputRange = /* see definition */; template <class R, class T> concept bool OutputRange = /* see definition */; template <class T> concept bool ForwardRange = /* see definition */; template <class T> concept bool BidirectionalRange = /* see definition */; template <class T> concept bool RandomAccessRange = /* see definition */; }}}}