[iterators] add free function that tests if an iterator range has a single element
[distance] properly write inner class assign_segment_or_box_points (as an empty class)
[distance] fix a typo in comments; use factored-out implementation of is_singleton (now called has_one_element in iterators); fix std::min issue (added parentheses);