[cfe-commits] [libcxx] r121600 - /libcxx/trunk/include/type_traits
Howard Hinnant
hhinnant at apple.com
Fri Dec 10 16:05:20 PST 2010
Author: hhinnant
Date: Fri Dec 10 18:05:19 2010
New Revision: 121600
URL: http://llvm.org/viewvc/llvm-project?rev=121600&view=rev
Log:
The implementation of the new definition of result_of (N3123) resulted in some test failures in [func.memfn] that I failed to previously notice. This corrects that mistake.
Modified:
libcxx/trunk/include/type_traits
Modified: libcxx/trunk/include/type_traits
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/type_traits?rev=121600&r1=121599&r2=121600&view=diff
==============================================================================
--- libcxx/trunk/include/type_traits (original)
+++ libcxx/trunk/include/type_traits Fri Dec 10 18:05:19 2010
@@ -1394,31 +1394,31 @@
typedef decltype(declval<_Fn>()(declval<_ArgTypes>()...)) type;
};
-template <class _MP, class _Tp, class ..._Args>
+template <class _MP, class _Tp, bool _IsMemberFunctionPtr, class ..._Args>
struct __result_of_mp {};
// member function pointer
template <class _R, class _Class, class _Tp, class ..._Params, class ..._Args>
-struct __result_of_mp<_R (_Class::*)(_Params...), _Tp, _Args...>
+struct __result_of_mp<_R (_Class::*)(_Params...), _Tp, true, _Args...>
{
typedef _R type;
};
template <class _R, class _Class, class _Tp, class ..._Params, class ..._Args>
-struct __result_of_mp<_R (_Class::*)(_Params...) const, _Tp, _Args...>
+struct __result_of_mp<_R (_Class::*)(_Params...) const, _Tp, true, _Args...>
{
typedef _R type;
};
template <class _R, class _Class, class _Tp, class ..._Params, class ..._Args>
-struct __result_of_mp<_R (_Class::*)(_Params...) volatile, _Tp, _Args...>
+struct __result_of_mp<_R (_Class::*)(_Params...) volatile, _Tp, true, _Args...>
{
typedef _R type;
};
template <class _R, class _Class, class _Tp, class ..._Params, class ..._Args>
-struct __result_of_mp<_R (_Class::*)(_Params...) const volatile, _Tp, _Args...>
+struct __result_of_mp<_R (_Class::*)(_Params...) const volatile, _Tp, true, _Args...>
{
typedef _R type;
};
@@ -1441,7 +1441,7 @@
};
template <class _R, class _Class, class _Tp>
-struct __result_of_mp<_R _Class::*, _Tp>
+struct __result_of_mp<_R _Class::*, _Tp, false>
: public __result_of_mdp<_R _Class::*, _Tp,
is_base_of<_Class, typename remove_reference<_Tp>::type>::value>
{
@@ -1449,7 +1449,8 @@
template <class _Fn, class _Tp, class ..._ArgTypes>
class __result_of<_Fn(_Tp, _ArgTypes...), false> // _Fn must be member pointer
- : public __result_of_mp<_Fn, _Tp, _ArgTypes...>
+ : public __result_of_mp<_Fn, _Tp, is_member_function_pointer<_Fn>::value,
+ _ArgTypes...>
{
};
More information about the cfe-commits
mailing list