Pass end iterator as a const&.