From 9fb298281723f14b55473e9858699a5875292be0 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Sun, 13 Nov 2011 23:51:42 +0000 Subject: [PATCH] cmath (atan2, [...]): Simplify constraining on the return type. 2011-11-13 Paolo Carlini * include/c_global/cmath (atan2, fmod, pow, copysign, fdim, fma, fmax, fmin, hypot, nextafter, remainder, remquo): Simplify constraining on the return type. * include/tr1/cmath (copysign, fdim, fma, fmax, fmin, hypot, nextafter, remainder, remquo): Likewise. From-SVN: r181341 --- libstdc++-v3/ChangeLog | 8 ++++ libstdc++-v3/include/c_global/cmath | 72 ++++++----------------------- libstdc++-v3/include/tr1/cmath | 55 ++++------------------ 3 files changed, 30 insertions(+), 105 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 50b54df457a0..6e506bac8a7f 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2011-11-13 Paolo Carlini + + * include/c_global/cmath (atan2, fmod, pow, copysign, fdim, + fma, fmax, fmin, hypot, nextafter, remainder, remquo): Simplify + constraining on the return type. + * include/tr1/cmath (copysign, fdim, fma, fmax, fmin, hypot, + nextafter, remainder, remquo): Likewise. + 2011-11-13 Gerald Pfeifer * using.xml: Use GNU/Linux. diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath index 016bdba04087..cd29f3d8ad50 100644 --- a/libstdc++-v3/include/c_global/cmath +++ b/libstdc++-v3/include/c_global/cmath @@ -173,10 +173,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template inline _GLIBCXX_CONSTEXPR - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type + typename __gnu_cxx::__promote_2<_Tp, _Up>::__type atan2(_Tp __y, _Up __x) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; @@ -311,10 +308,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template inline _GLIBCXX_CONSTEXPR - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type + typename __gnu_cxx::__promote_2<_Tp, _Up>::__type fmod(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; @@ -439,10 +433,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template inline _GLIBCXX_CONSTEXPR - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type + typename __gnu_cxx::__promote_2<_Tp, _Up>::__type pow(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; @@ -1256,11 +1247,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_copysignl(__x, __y); } template - constexpr - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type + constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type copysign(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; @@ -1332,11 +1319,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_fdiml(__x, __y); } template - constexpr - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type + constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type fdim(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; @@ -1352,12 +1335,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_fmal(__x, __y, __z); } template - constexpr - typename __gnu_cxx::__promote_3< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value - && __is_arithmetic<_Vp>::__value, - _Tp>::__type, _Up, _Vp>::__type + constexpr typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type fma(_Tp __x, _Up __y, _Vp __z) { typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type; @@ -1373,11 +1351,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_fmaxl(__x, __y); } template - constexpr - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type + constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type fmax(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; @@ -1393,11 +1367,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_fminl(__x, __y); } template - constexpr - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type + constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type fmin(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; @@ -1413,12 +1383,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_hypotl(__x, __y); } template - constexpr - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type - hypot(_Tp __x, _Up __y) + constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type + hypot(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; return hypot(__type(__x), __type(__y)); @@ -1575,11 +1541,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_nextafterl(__x, __y); } template - constexpr - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type + constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type nextafter(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; @@ -1609,11 +1571,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_remainderl(__x, __y); } template - constexpr - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type + constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type remainder(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; @@ -1629,11 +1587,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_remquol(__x, __y, __pquo); } template - constexpr - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type + constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type remquo(_Tp __x, _Up __y, int* __pquo) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; diff --git a/libstdc++-v3/include/tr1/cmath b/libstdc++-v3/include/tr1/cmath index 06631e51e973..e702bee16fa1 100644 --- a/libstdc++-v3/include/tr1/cmath +++ b/libstdc++-v3/include/tr1/cmath @@ -492,11 +492,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_copysignl(__x, __y); } template - inline - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type + inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type copysign(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; @@ -597,11 +593,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_fdiml(__x, __y); } template - inline - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type + inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type fdim(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; @@ -619,12 +611,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_fmal(__x, __y, __z); } template - inline - typename __gnu_cxx::__promote_3< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value - && __is_arithmetic<_Vp>::__value, - _Tp>::__type, _Up, _Vp>::__type + inline typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type fma(_Tp __x, _Up __y, _Vp __z) { typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type; @@ -640,11 +627,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_fmaxl(__x, __y); } template - inline - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type + inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type fmax(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; @@ -660,11 +643,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_fminl(__x, __y); } template - inline - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type + inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type fmin(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; @@ -683,11 +662,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_hypotl(__x, __y); } template - inline - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type + inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type hypot(_Tp __y, _Up __x) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; @@ -851,11 +826,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_nextafterl(__x, __y); } template - inline - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type + inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type nextafter(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; @@ -889,11 +860,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_remainderl(__x, __y); } template - inline - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type + inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type remainder(_Tp __x, _Up __y) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; @@ -909,11 +876,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { return __builtin_remquol(__x, __y, __pquo); } template - inline - typename __gnu_cxx::__promote_2< - typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value - && __is_arithmetic<_Up>::__value, - _Tp>::__type, _Up>::__type + inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type remquo(_Tp __x, _Up __y, int* __pquo) { typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type; -- 2.47.2