From 4fd97a6380d82d3f3ac8c5ee1dcdab7181794c13 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Sun, 23 Sep 2012 19:58:16 +0000 Subject: revert: stl_algobase.h (max, min): Use conditional operator. 2012-09-23 Paolo Carlini Revert: 2012-09-21 Paolo Carlini * include/bits/stl_algobase.h (max, min): Use conditional operator. From-SVN: r191652 --- libstdc++-v3/ChangeLog | 7 +++++++ libstdc++-v3/include/bits/stl_algobase.h | 26 ++++++++++++++++++++------ 2 files changed, 27 insertions(+), 6 deletions(-) (limited to 'libstdc++-v3') diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 606f565..70ee2a8 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2012-09-23 Paolo Carlini + + Revert: + 2012-09-21 Paolo Carlini + + * include/bits/stl_algobase.h (max, min): Use conditional operator. + 2012-09-23 Uros Bizjak PR libstdc++/54675 diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h index 3099d0d..fe30f6c 100644 --- a/libstdc++-v3/include/bits/stl_algobase.h +++ b/libstdc++-v3/include/bits/stl_algobase.h @@ -195,8 +195,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { // concept requirements __glibcxx_function_requires(_LessThanComparableConcept<_Tp>) - - return __b < __a ? __b : __a; + //return __b < __a ? __b : __a; + if (__b < __a) + return __b; + return __a; } /** @@ -216,8 +218,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { // concept requirements __glibcxx_function_requires(_LessThanComparableConcept<_Tp>) - - return __a < __b ? __b : __a; + //return __a < __b ? __b : __a; + if (__a < __b) + return __b; + return __a; } /** @@ -234,7 +238,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template inline const _Tp& min(const _Tp& __a, const _Tp& __b, _Compare __comp) - { return __comp(__b, __a) ? __b : __a; } + { + //return __comp(__b, __a) ? __b : __a; + if (__comp(__b, __a)) + return __b; + return __a; + } /** * @brief This does what you think it does. @@ -250,7 +259,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template inline const _Tp& max(const _Tp& __a, const _Tp& __b, _Compare __comp) - { return __comp(__a, __b) ? __b : __a; } + { + //return __comp(__a, __b) ? __b : __a; + if (__comp(__a, __b)) + return __b; + return __a; + } // If _Iterator is a __normal_iterator return its base (a plain pointer, // normally) otherwise return it untouched. See copy, fill, ... -- cgit v1.1