I'm learning to implement std::function and have found several articles about this. Unfortunately, none of their implementations can report a mistake when I assign a funtor with different signature. However, the STL version can alert me as I expect. Obviously, this kind of feature is useful to check such stupid mistake beforehand.
I read the source of MSVC implementation, but can not understand what happened within the template argument _Enable_If_callable_t of function& operator=(_Fx&& _Func) of std::function. Seems like this SFINAE trick prohibits such wrong assignment operator existing.
Please tell me the theory behind this and if I can implement such feature in my handmaking version.