Consider standard algorithms like, say, std::for_each.
std::for_each
template Function for_each(InputIterator first
The standard defines complexity constraints for the functions taking ranges. In the specific case of for_each (25.2.4 in the C++ standard):
for_each
Complexity: Applies f exactly last - first times
f
last - first
So it's effectively a no-op in your example.