Spec-Zone.ru › C++

std::ranges::drop_view<V>::reserve_hint

constexpr auto reserve_hint()
    requires ranges::approximately_sized_range<V>
(1) (since C++26)
constexpr auto reserve_hint() const
    requires ranges::approximately_sized_range<const V>
(2) (since C++26)

Let W be V for overload (1) or constV for overload (2). Equivalent to

constautos=static_cast<ranges::range_difference_t<W>>(ranges::reserve_hint(base_));
return to-unsigned-like(s< count_ ?0:s- count_);

Return value

The approximate size of the resulting range.

Notes

Feature-test macro Value Std Feature
__cpp_lib_ranges_reserve_hint 202502L (C++26) ranges::approximately_sized_range and reserve_hint (1,2)

Example

See also

size
returns the number of elements, provided only if the underlying (adapted) range satisfies sized_range
(public member function)

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/ranges/drop_view/reserve_hint

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API