diff --git a/sprout/algorithm/minmax_element.hpp b/sprout/algorithm/minmax_element.hpp index 9bba8516..8cea1a02 100644 --- a/sprout/algorithm/minmax_element.hpp +++ b/sprout/algorithm/minmax_element.hpp @@ -32,7 +32,7 @@ namespace sprout { iter_minmax(ForwardIteratorPair const& a, ForwardIterator b, Compare comp) { return ForwardIteratorPair( comp(*b, *sprout::first(a)) ? b : sprout::first(a), - comp(*sprout::second(b), *a) ? a : sprout::second(b) + comp(*b, *sprout::second(a)) ? sprout::second(a) : b ); }