diff options
author | Benjamin Kosnik <bkoz@redhat.com> | 2006-09-18 13:30:56 +0000 |
---|---|---|
committer | Benjamin Kosnik <bkoz@gcc.gnu.org> | 2006-09-18 13:30:56 +0000 |
commit | 105c6331b2b4a1e573bf237eaf9c572e18f8147c (patch) | |
tree | 45a99e66079ad8c76c24028341e6552ea91cf361 /libstdc++-v3/include/tr1/functional_iterate.h | |
parent | bcc4a44f6b929d0640370f1dd6aafccba481527c (diff) | |
download | gcc-105c6331b2b4a1e573bf237eaf9c572e18f8147c.tar.gz |
type_traits.h: New.
2006-09-18 Benjamin Kosnik <bkoz@redhat.com>
Peter Doerfler <gcc@pdoerfler.com>
Paolo Carlini <pcarlini@suse.de>
* include/ext/type_traits.h: New.
(__conditional_type): New.
(__numeric_traits): New.
(__add_unsigned): New.
(__remove_unsigned): New.
(__enable_if): New.
* include/Makefile.am: Add.
* include/Makefile.in: Regenerate.
* include/ext/pb_ds/detail/type_utils.hpp: Use ext include,
remove duplicates.
* include/tr1/hashtable_policy.h (IF): Use __conditional_type.
(_Max_digits10): Same.
(identity): Use _Identity.
(extract1st): Use _Select1st.
* include/tr1/random (_Select): Use __conditional_type.
(_To_Unsigned_Type): Use __add_unsigned. Linebreak fixups.
* include/bits/locale_facets.tcc (__to_unsigned_type): Remove, use
__add_unsigned.
* include/tr1/random.tcc: Fixups as above.
* include/tr1/unordered_map: Same.
* include/tr1/hashtable: Same.
* include/tr1/unordered_set: Same.
* include/ext/pb_ds/detail/gp_hash_table_map_/
standard_policies.hpp: Same.
* include/ext/pb_ds/detail/standard_policies.hpp: Same.
* include/ext/pb_ds/detail/typelist/typelist_filter.hpp: Same.
* include/ext/pb_ds/detail/binary_heap_/binary_heap_.hpp: Same.
* include/ext/pb_ds/detail/type_utils.hpp: Same.
* include/ext/pb_ds/trie_policy.hpp: Same.
* docs/html/ext/pb_ds/string_trie_e_access_traits.html: Same.
* include/bits/cpp_type_traits.h (__enable_if): Move to ext, make
boolean argument first.
* include/bits/locale_facets.h: Fixups for __enable_if argument
and namespace switch.
* include/bits/stl_algobase.h: Same.
* include/bits/stl_algo.h: Same.
* include/bits/stl_iterator.h: Same.
* include/bits/streambuf_iterator.h: Same.
* include/debug/safe_iterator.h: Same.
* include/tr1/hashtable_policy.h: Same.
* include/tr1/cmath: Same.
* include/tr1/functional: Same.
* include/tr1/functional_iterate.h: Same.
* include/std/std_streambuf.h: Same.
* include/c_std/std_cmath.h: Same.
* testsuite/util/testsuite_tr1.h: Same.
* testsuite/util/performance/assoc/multimap_common_type.hpp: Same.
Co-Authored-By: Paolo Carlini <pcarlini@suse.de>
Co-Authored-By: Peter Doerfler <gcc@pdoerfler.com>
From-SVN: r117024
Diffstat (limited to 'libstdc++-v3/include/tr1/functional_iterate.h')
-rw-r--r-- | libstdc++-v3/include/tr1/functional_iterate.h | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/libstdc++-v3/include/tr1/functional_iterate.h b/libstdc++-v3/include/tr1/functional_iterate.h index c29e341b8bf..0b039f944f6 100644 --- a/libstdc++-v3/include/tr1/functional_iterate.h +++ b/libstdc++-v3/include/tr1/functional_iterate.h @@ -117,12 +117,10 @@ template<typename _Functor _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS> */ template<typename _Functor _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS> inline - typename __enable_if< - typename result_of<_Functor(_GLIBCXX_TEMPLATE_ARGS)>::type, - (!is_member_pointer<_Functor>::value - && !is_function<_Functor>::value - && !is_function<typename remove_pointer<_Functor>::type>::value) - >::__type + typename __gnu_cxx::__enable_if<(!is_member_pointer<_Functor>::value + && !is_function<_Functor>::value + && !is_function<typename remove_pointer<_Functor>::type>::value), + typename result_of<_Functor(_GLIBCXX_TEMPLATE_ARGS)>::type>::__type __invoke(_Functor& __f _GLIBCXX_COMMA _GLIBCXX_REF_PARAMS) { return __f(_GLIBCXX_ARGS); @@ -131,11 +129,10 @@ template<typename _Functor _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS> #if _GLIBCXX_NUM_ARGS > 0 template<typename _Functor _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS> inline - typename __enable_if< - typename result_of<_Functor(_GLIBCXX_TEMPLATE_ARGS)>::type, - (is_member_pointer<_Functor>::value - && !is_function<_Functor>::value - && !is_function<typename remove_pointer<_Functor>::type>::value) + typename __gnu_cxx::__enable_if<(is_member_pointer<_Functor>::value + && !is_function<_Functor>::value + && !is_function<typename remove_pointer<_Functor>::type>::value), + typename result_of<_Functor(_GLIBCXX_TEMPLATE_ARGS)>::type >::__type __invoke(_Functor& __f _GLIBCXX_COMMA _GLIBCXX_REF_PARAMS) { @@ -146,10 +143,9 @@ template<typename _Functor _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS> // To pick up function references (that will become function pointers) template<typename _Functor _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS> inline - typename __enable_if< - typename result_of<_Functor(_GLIBCXX_TEMPLATE_ARGS)>::type, - (is_pointer<_Functor>::value - && is_function<typename remove_pointer<_Functor>::type>::value) + typename __gnu_cxx::__enable_if<(is_pointer<_Functor>::value + && is_function<typename remove_pointer<_Functor>::type>::value), + typename result_of<_Functor(_GLIBCXX_TEMPLATE_ARGS)>::type >::__type __invoke(_Functor __f _GLIBCXX_COMMA _GLIBCXX_REF_PARAMS) { @@ -667,9 +663,7 @@ class function<_Res(_GLIBCXX_TEMPLATE_ARGS)> */ template<typename _Functor> function(_Functor __f, - typename __enable_if<_Useless, - !is_integral<_Functor>::value>::__type - = _Useless()); + typename __gnu_cxx::__enable_if<!is_integral<_Functor>::value, _Useless>::__type = _Useless()); /** * @brief %Function assignment operator. @@ -723,7 +717,7 @@ class function<_Res(_GLIBCXX_TEMPLATE_ARGS)> * reference_wrapper<F>, this function will not throw. */ template<typename _Functor> - typename __enable_if<function&, !is_integral<_Functor>::value>::__type + typename __gnu_cxx::__enable_if<!is_integral<_Functor>::value, function&>::__type operator=(_Functor __f) { function(__f).swap(*this); @@ -841,8 +835,7 @@ template<typename _Res _GLIBCXX_COMMA _GLIBCXX_TEMPLATE_PARAMS> template<typename _Functor> function<_Res(_GLIBCXX_TEMPLATE_ARGS)> ::function(_Functor __f, - typename __enable_if<_Useless, - !is_integral<_Functor>::value>::__type) + typename __gnu_cxx::__enable_if<!is_integral<_Functor>::value, _Useless>::__type) : _Function_base() { typedef _Function_handler<_Signature_type, _Functor> _My_handler; |