[ 2024-03-12; Reflector poll ]
Set priority to 4 after reflector poll.
The proposed change is wrong, the new wording only associates with the second
condition, but should also apply when "last
is reachable from
first
".
This wording is relative to N4971.
Modify [iterator.operations] as indicated:
template<class InputIterator> constexpr typename iterator_traits<InputIterator>::difference_type distance(InputIterator first, InputIterator last);-4-Preconditions: last is reachable from first, or InputIterator meets the Cpp17RandomAccessIterator requirements,
andfirst is reachable from last , and typename iterator_traits<InputIterator>::difference_type can represent the result of this function call.-5- Effects: If InputIterator meets the Cpp17RandomAccessIterator requirements, returns (last - first); otherwise, increments first until last is reached and returns the number of increments.