Skip to content

ldm5180/range-v3

 
 

Repository files navigation

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.

About:

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.

Documentation:

Check out the (woefully incomplete) documentation here.

Other resources (mind the dates, the library probably has changed since then):

License:

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.

Supported Compilers

The code is known to work on the following compilers:

  • clang 3.6.2 (or later)
  • GCC 4.9.4 (or later) (C++14 support requires GCC 5.2; C++14 "extended constexpr" support is poor before 6.1.)
  • "Clang with Microsoft CodeGen" (Clang/C2) VS2015 Update 3 (or later)

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

  • on Travis-CI: Travis Build Status
  • on AppVeyor: AppVeyor Build Status

Release Notes:

  • 0.2.1 March 22, 2017 New in this release:
    • view::cartesian_product
    • action::reverse
  • 0.2.0 March 13, 2017 Bring many interfaces into sync with the Ranges TS.
    • Many interfaces are simply renamed. The following table shows the old names and the new. (All names are in the ranges::v3 namespace.)

      Old Name New Name
      indirect_swap iter_swap
      indirect_move iter_move
      iterator_value_t value_type_t
      iterator_reference_t reference_t
      iterator_difference_t difference_type_t
      iterator_size_t size_type_t
      iterator_rvalue_reference_t rvalue_reference_t
      iterator_common_reference_t iter_common_reference_t
      range_value_t range_value_type_t
      range_difference_t range_difference_type_t
      range_size_t range_size_type_t
      range_iterator_t iterator_t
      range_sentinel_t sentinel_t
    • common_iterator now requires that its two types (Iterator and Sentinel) are different. Use common_iterator_t<I, S> to get the old behavior (i.e., if the two types are the same, it is an alias for I; otherwise, it is common_iterator<I, S>).

    • The following iterator adaptors now work with iterators that return proxies from their postfix increment operator (i.e., operator++(int)):

      • common_iterator
      • counted_iterator
    • The following customization points are now implemented per the Ranges TS spec and will no longer find the associated unconstrained overload in namespace std:::

      • ranges::begin
      • ranges::end
      • ranges::size
      • ranges::swap
      • ranges::iter_swap

      (In practice, this has very little effect but it may effect overloading in rare situations.)

    • ranges::is_swappable now only takes one template parameter. The new ranges::is_swappable_with<T, U> tests whether T and U are swappable. ranges::is_swappable<T> is equivalent to ranges::is_swappable_with<T &, T &>.

    • The following object concepts have changed to conform with the Ranges TS specification, and approved changes (see P0547):

      • Destructible
      • Constructible
      • DefaultConstructible
      • MoveConstructible
      • MoveConstructible
      • Movable
      • Assignable
    • The View concept is no longer satisfied by reference types.

    • The syntax for defining a concept has changed slightly. See utility/iterator_concepts.hpp for examples.

  • 0.1.1 Small tweak to Writable concept to fix #537.
  • 0.1.0 March 8, 2017, Begin semantic versioning

Say Thanks!

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.

About

Experimental range library for C++11/14/17

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 98.8%
  • CMake 1.1%
  • Other 0.1%