diff options
author | Chanho Park <chanho61.park@samsung.com> | 2014-12-11 18:55:56 +0900 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-12-11 18:55:56 +0900 |
commit | 08c1e93fa36a49f49325a07fe91ff92c964c2b6c (patch) | |
tree | 7a7053ceb8874b28ec4b868d4c49b500008a102e /boost/algorithm/minmax_element.hpp | |
parent | bb4dd8289b351fae6b55e303f189127a394a1edd (diff) | |
download | boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.gz boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.tar.bz2 boost-08c1e93fa36a49f49325a07fe91ff92c964c2b6c.zip |
Imported Upstream version 1.57.0upstream/1.57.0
Diffstat (limited to 'boost/algorithm/minmax_element.hpp')
-rw-r--r-- | boost/algorithm/minmax_element.hpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/boost/algorithm/minmax_element.hpp b/boost/algorithm/minmax_element.hpp index 0d2efd8cd8..752f6cbdb1 100644 --- a/boost/algorithm/minmax_element.hpp +++ b/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; } |