diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2011-11-13 23:51:42 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2011-11-13 23:51:42 +0000 |
commit | 9fb298281723f14b55473e9858699a5875292be0 (patch) | |
tree | 6ca67dded89df69c1e6da599a96eece1a04f3a31 | |
parent | f36348b34b4513bc127d1b740e48b72b69f17c01 (diff) | |
download | gcc-9fb298281723f14b55473e9858699a5875292be0.zip gcc-9fb298281723f14b55473e9858699a5875292be0.tar.gz gcc-9fb298281723f14b55473e9858699a5875292be0.tar.bz2 |
cmath (atan2, [...]): Simplify constraining on the return type.
2011-11-13 Paolo Carlini <paolo.carlini@oracle.com>
* 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
-rw-r--r-- | libstdc++-v3/ChangeLog | 8 | ||||
-rw-r--r-- | libstdc++-v3/include/c_global/cmath | 72 | ||||
-rw-r--r-- | libstdc++-v3/include/tr1/cmath | 55 |
3 files changed, 30 insertions, 105 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 50b54df..6e506ba 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2011-11-13 Paolo Carlini <paolo.carlini@oracle.com> + + * 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 <gerald@pfeifer.com> * using.xml: Use GNU/Linux. diff --git a/libstdc++-v3/include/c_global/cmath b/libstdc++-v3/include/c_global/cmath index 016bdba..cd29f3d 100644 --- a/libstdc++-v3/include/c_global/cmath +++ b/libstdc++-v3/include/c_global/cmath @@ -173,10 +173,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<typename _Tp, typename _Up> 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<typename _Tp, typename _Up> 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<typename _Tp, typename _Up> 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<typename _Tp, typename _Up> - 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<typename _Tp, typename _Up> - 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<typename _Tp, typename _Up, typename _Vp> - 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<typename _Tp, typename _Up> - 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<typename _Tp, typename _Up> - 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<typename _Tp, typename _Up> - 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<typename _Tp, typename _Up> - 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<typename _Tp, typename _Up> - 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<typename _Tp, typename _Up> - 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 06631e5..e702bee 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<typename _Tp, typename _Up> - 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<typename _Tp, typename _Up> - 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<typename _Tp, typename _Up, typename _Vp> - 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<typename _Tp, typename _Up> - 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<typename _Tp, typename _Up> - 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<typename _Tp, typename _Up> - 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<typename _Tp, typename _Up> - 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<typename _Tp, typename _Up> - 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<typename _Tp, typename _Up> - 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; |