|
Range primitives | |||||||
|
Range concepts | |||||||||||||||||||
|
Range factories | |||||||||
|
Range adaptors | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
Helper items | |||||||||||||||||
|
Defined in header <ranges> | ||
Defined in header <iterator> | ||
inlinenamespace/* unspecified */{ inlineconstexprauto reserve_hint=/* unspecified */; | (since C++26) (customization point object) | |
Call signature | ||
template<class T> requires/* see below */ | (since C++26) | |
Estimates the number of elements int in constant time.
Given thesubexpression of whicht denotes the (possiblymaterialized) result object asE, and the type ofE asT
:
T
is a class or enumeration type.reserve_hint
is established as if by performingargument-dependent lookup only.Diagnosable ill-formed cases above result insubstitution failure whenranges::reserve_hint(E) appears in the immediate context of a template instantiation.
Contents |
The nameranges::reserve_hint
denotes acustomization point object, which is a constfunction object of aliteralsemiregular
class type. SeeCustomizationPointObject for details.
Wheneverranges::reserve_hint(e) is valid for an expressione, the return type isinteger-like.
Feature-test macro | Value | Std | Feature |
---|---|---|---|
__cpp_lib_ranges_reserve_hint | 202502L | (C++26) | ranges::reserve_hint |
This section is incomplete Reason: no example |
(C++20) | returns an integer equal to the size of a range (customization point object)[edit] |
(C++20) | returns a signed integer equal to the size of a range (customization point object)[edit] |
specifies that a range can estimate its size in constant time (concept)[edit] |