From: Paolo Carlini Date: Sun, 23 Sep 2012 19:58:16 +0000 (+0000) Subject: revert: stl_algobase.h (max, min): Use conditional operator. X-Git-Tag: misc/gccgo-go1_1_2~681 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4fd97a6380d82d3f3ac8c5ee1dcdab7181794c13;p=thirdparty%2Fgcc.git 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 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 606f5658786f..70ee2a88e1be 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 3099d0d10f6c..fe30f6ce9f5e 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, ...