EZInterval:帮助迭代不可迭代类型的 C++ 库

时间:2021-06-25 10:54:22
【文件属性】:
文件名称:EZInterval:帮助迭代不可迭代类型的 C++ 库
文件大小:24KB
文件格式:ZIP
更新时间:2021-06-25 10:54:22
C++ EZ间隔 一个 C++11 头文件库,用于帮助迭代数字类型。 随着 range-for 循环和算法在现代 C++ 代码中变得越来越普遍,在迭代基本类型(如int 、 char和指针)时,功能上的差距变得越来越明显。 EZInterval 允许迭代具有大多数迭代器属性(递增、递减、复制构造、相等比较)的类型,但不提供解引用运算符或operator->() 。 当您需要迭代器 ( ez::iterate ) 或索引 ( ez::indices ) 但想要使用基于范围的 for 循环时,有两个辅助函数可帮助您遍历容器。 // Iterate through digits of pi using an iterator std::cout << " pi: 3. " ; auto pi = std::vector< int>{ 1 , 4 , 5 , 9 , 2 , 6 , 5 , 3
【文件预览】:
EZInterval-master
----CMakeLists.txt(260B)
----examples()
--------collatz.cpp(571B)
--------range_for.cpp(774B)
--------CMakeLists.txt(510B)
--------sort_selected.cpp(1KB)
--------sieve_of_eratosthenes.cpp(473B)
--------look_and_say.cpp(825B)
--------fizzbuzz.cpp(765B)
----README.md(7KB)
----tests()
--------interval.cpp(11KB)
--------basic_interval.cpp(12KB)
--------CMakeLists.txt(500B)
--------main.cpp(86B)
--------direct_iterator.cpp(9KB)
--------ostream.hpp(918B)
----include()
--------CMakeLists.txt(240B)
--------ez()

网友评论