Revert fix for libstdc++/35637, thanks to other/36901.

2008-08-09  Paolo Carlini  <paolo.carlini@oracle.com>

	Revert fix for libstdc++/35637, thanks to other/36901.
	* include/tr1_impl/type_traits (__is_function_helper): New, uses
	variadic templates.
	(is_function): Forward to the latter.
	(__in_array): Remove.

From-SVN: r138906
This commit is contained in:
Paolo Carlini 2008-08-09 15:58:52 +00:00 committed by Paolo Carlini
parent a031f958a6
commit 6cccc20014
2 changed files with 22 additions and 19 deletions

View File

@ -1,3 +1,11 @@
2008-08-09 Paolo Carlini <paolo.carlini@oracle.com>
Revert fix for libstdc++/35637, thanks to other/36901.
* include/tr1_impl/type_traits (__is_function_helper): New, uses
variadic templates.
(is_function): Forward to the latter.
(__in_array): Remove.
2008-08-09 Paolo Carlini <paolo.carlini@oracle.com> 2008-08-09 Paolo Carlini <paolo.carlini@oracle.com>
* config/locale/darwin/ctype_members.cc: Include <cstdio>. * config/locale/darwin/ctype_members.cc: Include <cstdio>.

View File

@ -183,30 +183,25 @@ _GLIBCXX_BEGIN_NAMESPACE_TR1
{ }; { };
template<typename _Tp> template<typename _Tp>
struct __in_array struct remove_cv;
: public __sfinae_types
{
private:
template<typename _Up>
static __one __test(_Up(*)[1]);
template<typename> template<typename>
static __two __test(...); struct __is_function_helper
: public false_type { };
public: template<typename _Res, typename... _ArgTypes>
static const bool __value = sizeof(__test<_Tp>(0)) == 1; struct __is_function_helper<_Res(_ArgTypes...)>
}; : public true_type { };
/// is_abstract template<typename _Res, typename... _ArgTypes>
template<typename _Tp> struct __is_function_helper<_Res(_ArgTypes......)>
struct is_abstract; : public true_type { };
/// is_function /// is_function
template<typename _Tp> template<typename _Tp>
struct is_function struct is_function
: public integral_constant<bool, !(__in_array<_Tp>::__value : public integral_constant<bool, (__is_function_helper<typename
|| is_abstract<_Tp>::value remove_cv<_Tp>::type>::value)>
|| is_reference<_Tp>::value
|| is_void<_Tp>::value)>
{ }; { };
/// composite type traits [4.5.2]. /// composite type traits [4.5.2].