24 Ranges library [ranges]

24.3 Range access [range.access]

24.3.10 ranges​::​empty [range.prim.empty]

The name empty denotes a customization point object ([customization.point.object]).
The expression ranges​::​empty(E) for a subexpression E is expression-equivalent to:
  • bool((E).empty()) if it is a valid expression.
  • Otherwise, (ranges​::​size(E) == 0) if it is a valid expression.
  • Otherwise, EQ, where EQ is bool(ranges​::​begin(E) == ranges​::​end(E)) except that E is only evaluated once, if EQ is a valid expression and the type of ranges​::​begin(E) models forward_­iterator.
  • Otherwise, ranges​::​empty(E) is ill-formed.
    : This case can result in substitution failure when ranges​::​empty(E) appears in the immediate context of a template instantiation. — end note
Whenever ranges​::​empty(E) is a valid expression, it has type bool.
— end note