23 Ranges library [ranges]

23.4 Range primitives [range.prim]

23.4.2 empty [range.prim.empty]

The name empty denotes a customization point object.
The expression ranges::empty(E) for some 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 ForwardIterator.
  • Otherwise, ranges::empty(E) is ill-formed.
    [Note
    :
    This case can result in substitution failure when ranges::empty(E) appears in the immediate context of a template instantiation.
    end note
    ]
[Note
:
Whenever ranges::empty(E) is a valid expression, it has type bool.
end note
]