aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2012-09-23 19:58:16 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2012-09-23 19:58:16 +0000
commit4fd97a6380d82d3f3ac8c5ee1dcdab7181794c13 (patch)
tree5c984f233857a045329028fdbd6a5a9eedb5bce9 /libstdc++-v3
parentf18b27b3e272455be40fefd65725702f936c0cd1 (diff)
downloadgcc-4fd97a6380d82d3f3ac8c5ee1dcdab7181794c13.zip
gcc-4fd97a6380d82d3f3ac8c5ee1dcdab7181794c13.tar.gz
gcc-4fd97a6380d82d3f3ac8c5ee1dcdab7181794c13.tar.bz2
revert: stl_algobase.h (max, min): Use conditional operator.
2012-09-23 Paolo Carlini <paolo.carlini@oracle.com> Revert: 2012-09-21 Paolo Carlini <paolo.carlini@oracle.com> * include/bits/stl_algobase.h (max, min): Use conditional operator. From-SVN: r191652
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog7
-rw-r--r--libstdc++-v3/include/bits/stl_algobase.h26
2 files changed, 27 insertions, 6 deletions
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 <paolo.carlini@oracle.com>
+
+ Revert:
+ 2012-09-21 Paolo Carlini <paolo.carlini@oracle.com>
+
+ * include/bits/stl_algobase.h (max, min): Use conditional operator.
+
2012-09-23 Uros Bizjak <ubizjak@gmail.com>
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<typename _Tp, typename _Compare>
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<typename _Tp, typename _Compare>
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, ...