25 Ranges library [ranges]

25.3 Range access [range.access]

25.3.12 ranges​::​reserve_hint [range.prim.size.hint]

The name ranges​::​reserve_hint denotes a customization point object ([customization.point.object]).
Given a subexpression E with type T, let t be an lvalue that denotes the reified object for E.
Then:
  • If ranges​::​size(E) is a valid expression, ranges​::​reserve_hint(E) is expression-equivalent to ranges​::​size(E).
  • Otherwise, if auto(t.reserve_hint()) is a valid expression of integer-like type ([iterator.concept.winc]), ranges​::​reserve_hint(E) is expression-equivalent to auto(t.reserve_hint()).
  • Otherwise, if T is a class or enumeration type and auto(reserve_hint(t)) is a valid expression of integer-like type where the meaning of reserve_hint is established as-if by performing argument-dependent lookup only ([basic.lookup.argdep]), then ranges​::​reserve_hint(E) is expression-equivalent to that expression.
  • Otherwise, ranges​::​reserve_hint(E) is ill-formed.
[Note 1: 
Diagnosable ill-formed cases above result in substitution failure when ranges​::​reserve_hint(E) appears in the immediate context of a template instantiation.
— end note]
[Note 2: 
Whenever ranges​::​reserve_hint(E) is a valid expression, its type is integer-like.
— end note]