Помимо SFINAE, как здесь происходит разрешение перегрузки:
Код: Выделить всё
#include
// This overload is added to the set of overloads if C is
// a class or reference-to-class type and F is a pointer to member function of C
template
auto test(C c, F f) -> decltype((void)(c.*f)(), void())
{
std::cout decltype((void)((c->*f)()), void())
{
std::cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79168981/c-overload-resolutionthrough-return-type[/url]
Мобильная версия