ranges

Source code

Implementations of ranges that didn’t make C++20.

Understanding Range adaptors

The documentation for each range adaptor provides the following information:

Requires: Any constraints on constructing the adaptor.

Reference: The type you get by dereferencing the adaptor’s iterator type.

Category: The range category for the adaptor, which is either input, output, forward, bidirectional, random-access, or contiguous.

Sized: When the view is a sized_range, i.e. you can call std::ranges::size to get its size in O(1).

Common: When the view is a common_range, i.e. the iterator and sentinel for the view are the same type.

Const-iterable: When const TheRangeAdaptor is a range.

Borrowed: When the view is a borrowed_range i.e. iterators produced by the view can outlive the view itself.

Contents