|
Range primitives | |||||||
|
Range concepts | |||||||||||||||||||
|
Range factories | |||||||||
|
Range adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Helper items | |||||||||||||||||||||||||||
|
|
template<class T> requiresstd::is_object_v<T> | (since C++20) (exposition only*) | |
Some range adaptors such asranges::join_view andranges::lazy_split_view conditionally store value (e.g. an iterator) which is specified in terms of an exposition-only class templatenon-propagating-cache
.
The wrapper behaves exactly likestd::optional<T>, except that:
The wrapper encapsulates a cache containing a value. Clearing cache is an operation equivalent to resetting a contained value. Such operation is performed when copying or moving a wrapper.
Contents |
T | - | the type of the contained value, must be an object type |
constexpr/*non-propagating-cache*/ (const/*non-propagating-cache*/&)noexcept{} | (1) | (since C++20) |
constexpr/*non-propagating-cache*/ (/*non-propagating-cache*/&& other)noexcept{ other.reset();} | (2) | (since C++20) |
constexpr/*non-propagating-cache*/& operator=(const/*non-propagating-cache*/& other)noexcept | (1) | (since C++20) |
constexpr/*non-propagating-cache*/& operator=(/*non-propagating-cache*/&& other)noexcept | (2) | (since C++20) |
non-propagating-cache<T>::emplace-deref
template<class I> constexpr T&/*emplace-deref*/(const I& i); | (since C++20) (exposition only*) | |
Initializes the contained value bydirect-initializing (but not direct-list-initializing) with*i. If*this already contains a value before the call,reset() is called.
Returns a reference to the new contained value.
The program is ill-formed unless the declarationT t(*i); is well-formed for some invented variablet. If*i is a prvalue of possibly cv-qualifiedT
, then it is not required to be movable.
constructs theoptional object(public member function of std::optional<T> )[edit] | |
destroys the contained value, if there is one (public member function of std::optional<T> )[edit] | |
assigns contents (public member function of std::optional<T> )[edit] | |
Observers | |
accesses the contained value (public member function of std::optional<T> )[edit] | |
checks whether the object contains a value (public member function of std::optional<T> )[edit] | |
Modifiers | |
destroys any contained value (public member function of std::optional<T> )[edit] | |
constructs the contained value in-place (public member function of std::optional<T> )[edit] |
non-propagating-cache
is used in implementations to cache the result ofbegin() to provide an amortized constant time complexity of the method.
(C++20) | aview consisting of the sequence obtained from flattening aview ofrange s(class template)(range adaptor object)[edit] |
aview consisting of the sequence obtained from flattening a view of ranges, with the delimiter in between elements(class template)(range adaptor object)[edit] | |
aview over the subranges obtained from splitting anotherview using a delimiter(class template)(range adaptor object)[edit] | |
aview over the subranges obtained from splitting anotherview using a delimiter(class template)(range adaptor object)[edit] | |
a range ofview s that areN -sized non-overlapping successive chunks of the elements of anotherview (class template)(range adaptor object)[edit] |