Released: Sept 1, 2019.
gcc-9.x portability fixes.
Released: Aug 26, 2019.
Bring many interfaces into sync with the C++20 draft.
RANGES_DEEP_STL_INTEGRATION
configuration option that makes your STL implementation default to structural conformance to infer iterator category, as in C++20. Applies to libc++, libstdc++, and MSVC's Standard Library.ranges::cpp20
namespace that contains all the functionality of C++20's std::ranges
namespace.ranges::begin
ranges::end
ranges::rbegin
ranges::rend
ranges::cbegin
ranges::cend
ranges::crbegin
ranges::crend
ranges::data
ranges::cdata
iterator_concept
type alias in addition to iterator_category
– either as a nested type or as a member of a std::iterator_traits
specialization – to denote conformance to the C++20 iterator concepts as distinct from the C++98 iterator requirements. (See P1037 "Deep Integration of the Ranges TS" for more information.)ranges::value_type
trait has been renamed to readable_traits
.ranges::difference_type
trait has been renamed to incrementable_traits
.ranges::iterator_category
trait has been deprecated. Specialize std::iterator_traits
to non-intrusively specify an iterator's category and (optionally) concept.ranges::view
namespace to ranges::views
and ranges::action
to ranges::actions
(with deprecated namespace aliases for migration).view::bounded
to views::common
.unreachable
to unreachable_sentinel_t
.dangling
from a class template that wraps an iterator to a class that acts as a placeholder for an iterator that would otherwise dangle.subrange
as a view that wraps an iterator/sentinel pair; deprecate iterator_range
.ranges::to_
to ranges::to
and extend it to support converting a range-of-ranges to a container-of-containers.ranges::v3
inline versioning namespace.The following views have had minor changes to bring them into conformance with the C++20 working draft:
join_view
single_view
empty_view
split_view
reverse_view
all_view
take_view
iota_view
iota_view<std::[u]intmax_t>
, in particular, is given a user-defined difference_type
that avoids integer overflow.
Old Name | New Name |
---|---|
value_type_t | iter_value_t |
reference_t | iter_reference_t |
difference_type_t | iter_difference_t |
size_type_t | deprecated |
rvalue_reference_t | iter_rvalue_reference_t |
range_value_type_t | range_value_t |
range_difference_type_t | range_difference_t |
range_size_type_t | range_size_t |
Released: Apr 30, 2019.
view::enumerate
, from view::addressof
, from unstable_remove_if
algorithm and action, from adjacent_remove_if
algorithm and action, from ostream_joiner
, from view::drop_while
and view::take_while
get projection support, from view::filter
and view::remove_if
get projection support, from view::unique
accepts optional comparison operator, from action::slice
supports sliding from the end, from view::generate_n
, from GitHub user view_adaptor
supports basic_iterator
-style mixins, from ranges::advance
for random-access iterators for n==0
, from Released: Oct 18, 2018.
single_view
returns by const &
(see #817).reverse_view
of a non-Sized, non-Bounded RandomAccess range (eg., a null-terminated string) no longer satisfies SizedRange.generate
and generate_n
views now return the generated values by xvalue reference (T &&
) to the value cached within the view (see #905).single
and empty
views are much closer to the versions as specified in P0896.Released: Sept 19, 2018.
any_view<T, category::sized | category::input>
(see #869).iter_move
of a ranges::reverse_iterator
(see #888).move_sentinel
comparisons (see #889).boost::advance
and std::advance
(see #893).Released: May 15, 2018.
view::exclusive_scan
(thanks to GitHub user -takeda).const
overloads of .empty()
and .size()
(see ericniebler/stl2#793).subspan
interface tweaks.view::split
(see this stackoverflow question).view::stride
(see ericniebler/stl2#805).const
-correctness problem in view::chunk
(see this stackoverflow question).ranges::result_of
with ranges::invoke_result
.view::drop
over RandomAccessRanges.view::cartesian_product
fixes (see ericniebler/stl2#820, ericniebler/stl2#823).volatile
std::initializer_list
s (see ericniebler/stl2#826).const
-correctness problem of view::take
.Released: February 17, 2018.
Writable
(see ericniebler/stl2#387).view_interface
gets a bounds-checking at
method.chunk_view
works on Input ranges.group_by_view
.partial_sum
numeric algorithm.ContiguousIterator
concept and contiguous_iterator_tag
iterator category tag.span
fixes.action::insert
avoids interfering with vector
's exponentional growth strategy.shared
view for views that need container-like scratch space to do their work.reverse_view
.ranges::reference_wrapper
to avoid LWG#2993.any_view
, the type-erased view wrapper.equal
algorithm is constexpr
in C++14.stride_view
no longer needs an atomic
data member.const
-correct drop_view
.adjacent_filter_view
supports bidirectional iteration.view_adaptor
cleanup to remove the need for a mutable
data member holding the adapted view.counting_iterator
post-increment bug.tail_view
of an empty range is an empty range, not undefined behavior.Released: June 30, 2017.
any_view
s are now much more efficient (from )<thread>
header (from )Released: June 21, 2017.
ranges::experimental::generator
(from )ranges::optional
now behaves like std::optional
(from )Released: May 16, 2017.
view::chunk
works on Input ranges (from )for_each_n
algorithm (from )Released: April 12, 2017.
Fix the following bug:
action::stable_sort
of vector
broken on Clang 3.8.1 since ~last Xmas (ericniebler/range-v3#632).Released: April 4, 2017.
Fix the following bug:
Released: March 30, 2017.
New in this release:
view::linear_distribute(from,to,n)
- A view of n
elements between from
and to
, distributed evenly.view::indices(n)
- A view of the indices [0,1,2...n-1]
.view::closed_indices(n)
- A view of the indices [0,1,2...n]
.This release deprecates view::ints(n)
as confusing to new users.
Released: March 22, 2017.
New in this release:
view::cartesian_product
action::reverse
Released: March 13, 2017.
Bring many interfaces into sync with the Ranges TS.
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>
).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 &>
.Destructible
Constructible
DefaultConstructible
MoveConstructible
MoveConstructible
Movable
Assignable
View
concept is no longer satisfied by reference types.Writable
concept to fix #537.