C++范围 TS 包括实验路径
C++ Ranges TS include experimental path
我想使用C++范围。工作草案,C++范围的扩展 说:
The Ranges library provides the Ranges library headers, shown in Table 2.
Table 2 — Ranges TS library headers
<experimental/ranges/algorithm> <experimental/ranges/random>
<experimental/ranges/concepts> <experimental/ranges/tuple>
<experimental/ranges/functional> <experimental/ranges/utility>
<experimental/ranges/iterator>
我发现的最接近的是 Range-v3 - 标准库的范围算法、视图和操作,上面写着:
Range library for C++11/14/17. This code is the basis of a formal proposal to add range support to the C++ standard library.
This library is header-only. You can get the source code from the range-v3 repository on github. To compile with Range-v3, you can either #include the entire library:
#include <range/v3/all.hpp>
Or you can #include only the core, and then the individual headers you want:
#include <range/v3/core.hpp>
#include <range/v3/....
解释Range TS与"实验性"和Range V3之间包含的差异。在哪里可以找到带有"实验/范围"的范围?意义何在,重要吗?这应该是控制它的编译器选项吗?
范围 TS 是一个C++的技术规范。默认情况下,TS 中任何库功能的任何标头都以"实验性"为前缀,并且这些标头包含的任何内容都将进入命名空间std::experimental
。
Range-v3 是一个C++库,它实现了与范围相关的各种功能。但它没有做的是实现范围 TS 本身。也就是说,它不是 TS 的正式实现。因此,它可以将其标题放在任何它喜欢的地方;它不受 TS 规则的约束。
如果编译器实现了 Ranges TS,则可以在文档中查看访问它所需的编译器开关(如果有(。由于范围 TS 是针对概念 TS 编写的,因此您可能至少需要激活它。如果您下载了独立的 Ranges TS 实现,那么文档将(希望(告诉您如何使用它。
Range-v3
早于 Range TS,TS 中的功能基于 range-v3 的功能(并且是其子集(。范围 TS 需要一个支持概念 TS 的编译器;range-v3 没有,因此 range-v3 不可能是 TS 实现。
如果您正在寻找 Ranges TS 的参考实现,请在 GitHub 上找到 cmcstl2 项目。
相关文章:
- 如何将更多文件夹添加到c++include路径
- 带有特殊路径部分的"std::filesystem::weakly_canonical"失败
- C++A*算法并不总是在路径中具有目标节点
- 从函数角度看ID到文件路径的内部与外部映射
- boost xml parsingl将xml的路径作为变量发送
- 对于MacOS上的G++,如何添加默认的include目录/usr/local/include和默认的库搜索路径/usr
- 如何使用cppcheck处理半相对包含路径
- 在C++中设置基于操作系统的文件路径
- 基于编译器选项的编译二进制路径
- 按边长度递归搜索图中所有可行路径
- 使用变量值作为 PlaySound 中的路径
- 如何转换真实路径 CString c++
- 从 GUID 获取 USB 卷路径
- 查找 GCD:并非所有控制路径都返回值
- C++17 文件系统::remove_all 带有通配符路径
- 在带有尾部斜杠的路径上返回 std::filesystem::create_directories() 的值
- 获取当前正在运行的 exe 名称(不是路径)
- 如何从 Skia 路径几何体中获取网格?
- C++范围 TS 包括实验路径
- C++ GCC/MinGW 路径:ssp、ext、tr1;并行,扩展,位,实验