This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of TC1 status.
Section: 27.8.9 [alg.min.max] Status: TC1 Submitter: Nico Josuttis Opened: 2000-02-26 Last modified: 2016-02-10
Priority: Not Prioritized
View all other issues in [alg.min.max].
View all issues with TC1 status.
The standard doesn't specify what min_element() and max_element() shall return if the range is empty (first equals last). The usual implementations return last. This problem seems also apply to partition(), stable_partition(), next_permutation(), and prev_permutation().
In 27.8.9 [alg.min.max] - Minimum and maximum, paragraphs 7 and 9, append: Returns last if first==last.
The LWG looked in some detail at all of the above mentioned algorithms, but believes that except for min_element() and max_element() it is already clear that last is returned if first == last.