a question on __invoke

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 ;>

The enable_if conditions are taken directly from the description in the standard (using N3936 here), 20.9.2/1:

Define INVOKE (f, t1, t2, …, tN) as follows:

— (t1.*f)(t2, …, tN) when f is a pointer to a member function of a class T and t1 is an object of
type T or a reference to an object of type T or a reference to an object of a type derived from T;

— ((*t1).*f)(t2, …, tN) when f is a pointer to a member function of a class T and t1 is not one of
the types described in the previous item;

— Bullet #3 elided

— Bullet #4 elided

— Bullet #5 elided

— Marshall

Thank you for your reply!
And after reading the whole std::bind implementation, I’ve realized that std::bind could take pointer to object as well as shared_ptr/unique_ptr as it’s input.