I don’t quite understand about __invoke bullet2 and bullet4.
for example, bullet2:
template <class _Fp, class _A0, class …_Args,
class = typename enable_if
<
is_member_function_pointer<typename remove_reference<_Fp>::type>::value &&
!is_base_of<typename remove_reference<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType>::type,
typename remove_reference<_A0>::type>::value::type
_LIBCPP_INLINE_VISIBILITY
auto
__invoke(_Fp&& __f, _A0&& __a0, _Args&& …__args)
→ decltype(((_VSTD::forward<_A0>(__a0)).__f)(_VSTD::forward<_Args>(__args)…));
this functions invokes f with __(*a0).f(args) (__as written in header __functional_base), so I guess that a0/A0 has the type of Pointer to Class? (thus, of course, isn’t a base class of himself)
Then why did enable_if just test if ClassType of f isn’t a base class of A0 ?
wouldn’t
&& is_base_of<member_pointer_traits<_Fp>::ClassType, remove_pointer>::value
be more accurate? also, wouldn’t <Some_Class_C::*Fp, Some_Class_D, Some_Args…> makes the value of enable_if to be true?
I must guess that there is something I hadn’t taken into consideration ;>