The function call expression at 
#1 invokes 
std::ranges::distance,
not 
std::distance, despite that
(a) the iterator type returned from 
begin(vec) and 
end(vec)
may be associated with namespace 
std and
(b) 
std::distance is more specialized (
[temp.func.order]) than
std::ranges::distance since the former requires its first two parameters
to have the same type
.