From: Daniel Frey Date: Tue, 26 Jan 2010 13:33:06 +0000 (+0000) Subject: functional: Use enable_if instead of __enable_if throughout, do not include ext/type_... X-Git-Tag: releases/gcc-4.5.0~1052 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b054f631a94b4af133e564f9995473aaabd4911;p=thirdparty%2Fgcc.git functional: Use enable_if instead of __enable_if throughout, do not include ext/type_traits.h. 2010-01-26 Daniel Frey * include/std/functional: Use enable_if instead of __enable_if throughout, do not include ext/type_traits.h. (is_placeholder, is_bind_expression): Use integral_constant. From-SVN: r156246 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index e152d2ca1cc2..a0d319720f82 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2010-01-26 Daniel Frey + + * include/std/functional: Use enable_if instead of __enable_if + throughout, do not include ext/type_traits.h. + (is_placeholder, is_bind_expression): Use integral_constant. + 2010-01-25 Paolo Carlini * testsuite/util/testsuite_common_types.h (has_bitwise_operators): diff --git a/libstdc++-v3/include/std/functional b/libstdc++-v3/include/std/functional index 68b784233662..29b19f67d0f8 100644 --- a/libstdc++-v3/include/std/functional +++ b/libstdc++-v3/include/std/functional @@ -56,7 +56,6 @@ #include #include #include -#include namespace std { @@ -234,12 +233,12 @@ namespace std */ template inline - typename __gnu_cxx::__enable_if< + typename enable_if< (!is_member_pointer<_Functor>::value && !is_function<_Functor>::value && !is_function::type>::value), typename result_of<_Functor(_Args...)>::type - >::__type + >::type __invoke(_Functor& __f, _Args&&... __args) { return __f(std::forward<_Args>(__args)...); @@ -248,11 +247,11 @@ namespace std // To pick up function references (that will become function pointers) template inline - typename __gnu_cxx::__enable_if< + typename enable_if< (is_pointer<_Functor>::value && is_function::type>::value), typename result_of<_Functor(_Args...)>::type - >::__type + >::type __invoke(_Functor __f, _Args&&... __args) { return __f(std::forward<_Args>(__args)...); @@ -769,10 +768,7 @@ namespace std */ template struct is_bind_expression - { static const bool value = false; }; - - template - const bool is_bind_expression<_Tp>::value; + : public false_type { }; /** * @brief Determines if the given type _Tp is a placeholder in a @@ -780,10 +776,8 @@ namespace std */ template struct is_placeholder - { static const int value = 0; }; - - template - const int is_placeholder<_Tp>::value; + : public integral_constant + { }; /// The type of placeholder objects defined by libstdc++. template struct _Placeholder { }; @@ -837,10 +831,8 @@ namespace std */ template struct is_placeholder<_Placeholder<_Num> > - { static const int value = _Num; }; - - template - const int is_placeholder<_Placeholder<_Num> >::value; + : public integral_constant + { }; /** * Stores a tuple of indices. Used by bind() to extract the elements @@ -1346,18 +1338,12 @@ namespace std /// Class template _Bind is always a bind expression. template struct is_bind_expression<_Bind<_Signature> > - { static const bool value = true; }; - - template - const bool is_bind_expression<_Bind<_Signature> >::value; + : public true_type { }; /// Class template _Bind_result is always a bind expression. template struct is_bind_expression<_Bind_result<_Result, _Signature> > - { static const bool value = true; }; - - template - const bool is_bind_expression<_Bind_result<_Result, _Signature> >::value; + : public true_type { }; /// bind template @@ -1850,8 +1836,8 @@ namespace std */ template function(_Functor __f, - typename __gnu_cxx::__enable_if< - !is_integral<_Functor>::value, _Useless>::__type + typename enable_if< + !is_integral<_Functor>::value, _Useless>::type = _Useless()); /** @@ -1927,8 +1913,7 @@ namespace std * reference_wrapper, this function will not throw. */ template - typename __gnu_cxx::__enable_if::value, - function&>::__type + typename enable_if::value, function&>::type operator=(_Functor&& __f) { function(std::forward<_Functor>(__f)).swap(*this); @@ -1937,8 +1922,7 @@ namespace std /// @overload template - typename __gnu_cxx::__enable_if::value, - function&>::__type + typename enable_if::value, function&>::type operator=(reference_wrapper<_Functor> __f) { function(__f).swap(*this); @@ -2059,8 +2043,8 @@ namespace std template function<_Res(_ArgTypes...)>:: function(_Functor __f, - typename __gnu_cxx::__enable_if< - !is_integral<_Functor>::value, _Useless>::__type) + typename enable_if< + !is_integral<_Functor>::value, _Useless>::type) : _Function_base() { typedef _Function_handler<_Signature_type, _Functor> _My_handler;