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.
Why does C++ need another range library? Simply put, the existing solutions haven't kept up with the rapid evolution of C++. Range v3 is a library for the future C++. Not only does it work well with today's C++ -- move semantics, lambdas, automatically deduced types and all -- it also anticipates tomorrow's C++ with Concepts.
Range v3 forms the basis of a proposal to add range support to the standard library (N4128: Ranges for the Standard Library). It also will be the reference implementation for an upcoming Technical Specification. These are the first steps toward turning ranges into an international standard.
Check out the (woefully incomplete) documentation here.
Other resources (mind the dates, the library probably has changed since then):
-
Usage:
- Talk: CppCon 2015: Eric Niebler "Ranges for the Standard Library", 2015.
- A slice of Python in C++, 07.12.2014.
- Actions (back then called Container Algorithms), 23.11.2014.
- Range comprehensions, 27.04.2014.
- Input iterators vs input ranges, 07.11.2013.
-
Design / Implementation:
- Rationale behind range-v3: N4128: Ranges for the standard library Revision 1, 2014.
- Ranges TS: N4560: C++ Extensions for Ranges, 2015.
- Implementation of customization points in range-v3:
- Proxy iterators in range-v3:
- Metaprogramming utilities:
- See the meta documentation, the library has changed significantly since the 2014 blog post.
- Concept emulation layer: Concept checking in C++11, 2013.
- C++Now 2014: Eric Niebler "C++11 Library Design", 2014.
Most of the source code in this project are mine, and those are under the Boost Software License. Parts are taken from Alex Stepanov's Elements of Programming, Howard Hinnant's libc++, and from the SGI STL. Please see the attached LICENSE file and the CREDITS file for the licensing and acknowledgments.
The code is known to work on the following compilers:
- clang 3.5.2
- GCC 4.8.5 (C++14 support requires GCC 5.2; C++14 "extended constexpr" support is poor before 6.1.)
- VS2015 Update 3 "Clang with Microsoft CodeGen" (Clang/C2)
Development Status: This code is fairly stable, well-tested, and suitable for casual use, although currently lacking documentation. No promise is made about support or long-term stability. This code will evolve without regard to backwards compatibility.
Build status
I do this work because I love it and because I love C++ and want it to be as excellent as I know it can be. If you like my work and are looking for a way to say thank you, you can leave a supportive comment on my blog. Or you could leave me some kudos on my Open Hub range-v3 contribution page. Just click the Give Kudos button here.