type_traits (is_member_function_pointer): Remove ugly workaround for c++/19076.

2005-02-21  Paolo Carlini  <pcarlini@suse.de>

	* include/tr1/type_traits (is_member_function_pointer):
	Remove ugly workaround for c++/19076.

From-SVN: r95360
This commit is contained in:
Paolo Carlini 2005-02-21 23:51:51 +00:00 committed by Paolo Carlini
parent 52a8962603
commit 11996a3c45
2 changed files with 8 additions and 210 deletions

View File

@ -1,3 +1,8 @@
2005-02-21 Paolo Carlini <pcarlini@suse.de>
* include/tr1/type_traits (is_member_function_pointer):
Remove ugly workaround for c++/19076.
2005-02-21 Paolo Carlini <pcarlini@suse.de> 2005-02-21 Paolo Carlini <pcarlini@suse.de>
* include/bits/basic_string.tcc (_Rep::_M_destroy): Don't * include/bits/basic_string.tcc (_Rep::_M_destroy): Don't

View File

@ -151,218 +151,11 @@ namespace tr1
_DEFINE_SPEC(2, is_member_object_pointer, _Tp _Cp::*, _DEFINE_SPEC(2, is_member_object_pointer, _Tp _Cp::*,
!is_function<_Tp>::value) !is_function<_Tp>::value)
// Due to c++/19076, for the time being we cannot use the correct, neat
// implementation :-(
//
// template<typename>
// struct is_member_function_pointer
// : public false_type { };
// _DEFINE_SPEC(2, is_member_function_pointer, _Tp _Cp::*,
// is_function<_Tp>::value)
//
// Temporary workaround for member functions with up to 15 arguments:
template<typename> template<typename>
struct __is_mfp_helper
{ static const bool __value = false; };
template<typename _Rt, typename _Cp>
struct __is_mfp_helper<_Rt (_Cp::*) ()>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp>
struct __is_mfp_helper<_Rt (_Cp::*) (...)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, ...)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, ...)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, ...)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, ...)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, ...)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, ...)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5, typename _A6>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5, typename _A6>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
...)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5, typename _A6, typename _A7>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
_A7)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5, typename _A6, typename _A7>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
_A7, ...)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
typename _A8>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
_A7, _A8)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
typename _A8>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
_A7, _A8, ...)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
typename _A8, typename _A9>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
_A7, _A8, _A9)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
typename _A8, typename _A9>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
_A7, _A8, _A9, ...)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
typename _A8, typename _A9, typename _A10>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
_A7, _A8, _A9, _A10)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
typename _A8, typename _A9, typename _A10>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
_A7, _A8, _A9, _A10, ...)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
typename _A8, typename _A9, typename _A10, typename _A11>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
_A7, _A8, _A9, _A10, _A11)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
typename _A8, typename _A9, typename _A10, typename _A11>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
_A7, _A8, _A9, _A10, _A11, ...)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
typename _A8, typename _A9, typename _A10, typename _A11,
typename _A12>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
_A7, _A8, _A9, _A10, _A11, _A12)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
typename _A8, typename _A9, typename _A10, typename _A11,
typename _A12>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
_A7, _A8, _A9, _A10, _A11, _A12, ...)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
typename _A8, typename _A9, typename _A10, typename _A11,
typename _A12, typename _A13>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
_A7, _A8, _A9, _A10, _A11, _A12,
_A13)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
typename _A8, typename _A9, typename _A10, typename _A11,
typename _A12, typename _A13>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
_A7, _A8, _A9, _A10, _A11, _A12,
_A13, ...)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
typename _A8, typename _A9, typename _A10, typename _A11,
typename _A12, typename _A13, typename _A14>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
_A7, _A8, _A9, _A10, _A11, _A12,
_A13, _A14)>
{ static const bool __value = true; };
template<typename _Rt, typename _Cp, typename _A0, typename _A1, typename _A2,
typename _A3, typename _A4, typename _A5, typename _A6, typename _A7,
typename _A8, typename _A9, typename _A10, typename _A11,
typename _A12, typename _A13, typename _A14>
struct __is_mfp_helper<_Rt (_Cp::*) (_A0, _A1, _A2, _A3, _A4, _A5, _A6,
_A7, _A8, _A9, _A10, _A11, _A12,
_A13, _A14, ...)>
{ static const bool __value = true; };
template<typename _Tp>
struct is_member_function_pointer struct is_member_function_pointer
: public integral_constant<bool, (__is_mfp_helper<typename : public false_type { };
remove_cv<_Tp>::type>::__value)> _DEFINE_SPEC(2, is_member_function_pointer, _Tp _Cp::*,
{ }; is_function<_Tp>::value)
template<typename _Tp, bool = (is_fundamental<_Tp>::value template<typename _Tp, bool = (is_fundamental<_Tp>::value
|| is_array<_Tp>::value || is_array<_Tp>::value