From 1660dc9d485e097eec12b7508386f338bfeda184 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Mon, 17 Dec 2012 16:02:38 +0000 Subject: [PATCH] merge bug fix for minmax_element to release; Fixes #7752 [SVN r82049] --- include/boost/algorithm/minmax_element.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/boost/algorithm/minmax_element.hpp b/include/boost/algorithm/minmax_element.hpp index 0d2efd8..752f6cb 100644 --- a/include/boost/algorithm/minmax_element.hpp +++ b/include/boost/algorithm/minmax_element.hpp @@ -99,8 +99,10 @@ namespace boost { // if odd number of elements, treat last element if (first != last) { // odd number of elements - if (comp(first, min_result)) - min_result = first, potential_min_result = last; + if (comp(first, min_result)) { + min_result = first; + potential_min_result = last; + } else if (comp(max_result, first)) max_result = first; }