| ||||||||||||||||||||||
| Range primitives | |||||||
| |||||||
| Range concepts | |||||||||||||||||||
| |||||||||||||||||||
| Range factories | |||||||||
| |||||||||
| Range adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Helper items | |||||||||||||||||
| |||||||||||||||||
Defined in header <ranges> | ||
template<class T> concept approximately_sized_range=ranges::range<T>&& | (since C++26) | |
Theapproximately_sized_range concept specifies the requirements of arange type that can estimate its size in constant time with thereserve_hint function.
Contents |
Given an lvaluet of typestd::remove_reference_t<T>,T modelsapproximately_sized_range only if
forward_iterator,ranges::reserve_hint(t) is well-defined regardless of the evaluation ofranges::begin(t) (in other words, a single-pass approximately sized range may support a call toreserve_hint only before the first call tobegin, but a forward range must support size at all times).| Feature-test macro | Value | Std | Feature |
|---|---|---|---|
__cpp_lib_ranges_reserve_hint | 202502L | (C++26) | ranges::approximately_sized_range |
| This section is incomplete Reason: no example |
(C++20) | specifies that a range knows its size in constant time (concept)[edit] |