std::ranges::take_view<V>::reserve_hint
From cppreference.com
 
 
 
 
 
 C++ 
 Feature test macros (C++20)
 Concepts library (C++20)
 Metaprogramming library (C++11)
 Ranges library (C++20)
 Filesystem library (C++17)
 Concurrency support library (C++11)
 Execution control library (C++26)
Ranges library 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 
 
 
 
 
 
 
 
 
 
 
 
	
		
(C++23)(C++23)
  (C++23)(C++23)
(C++23)(C++23)
  (C++26)(C++26)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
  (C++23)(C++23)
(C++23)
(C++23)(C++23)
(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)
    std::ranges::take_view 
 
take_view::reserve_hint
(C++26)
 Member functions
 Non-member functions
constexpr auto reserve_hint()
 (1) 
 (since C++26) 
constexpr auto reserve_hint() const
 (2) 
 (since C++26) 
Let W be V for overload (1) or const V for overload (2). Equivalent to
if constexpr (ranges::approximately_sized_range<W>)
{
    auto n = static_cast<ranges::range_difference_t <W>>(ranges::reserve_hint(base_ ));
    return to-unsigned-like(ranges::min (n, count_ ));
}
return to-unsigned-like(count_ );
Contents
[edit] Return value
The approximate size of the resulting range.
[edit] Notes
| Feature-test macro | Value | Std | Feature | 
|---|---|---|---|
| __cpp_lib_ranges_reserve_hint | 202502L | (C++26) | ranges::approximately_sized_range and reserve_hint(1,2) | 
[edit] Example
 This section is incomplete
Reason: no example
Reason: no example
[edit] See also
 
 returns the number of elements, provided only if the underlying (adapted) range satisfies 
(public member function) [edit]
sized_range (public member function) [edit]