boost::text::distance
// In header: <boost/text/algorithm.hpp> template<typename Iter, typename Sentinel> std::ptrdiff_t distance(Iter first, Sentinel last);
Range-friendly version of std::distance(), taking an iterator and a sentinel.
std::distance()