Determining which overload was selected
Let's say I have some arbitrary complicated overloaded function: template <class T> void foo(T&& ); template <class T> void foo(T* ); void foo(int ); I want to know, for a given expression, which foo() gets called. For example, given some macro WHICH_OVERLOAD : using T = WHICH_OVERLOAD(foo, 0); // T is void(*)(int); using U = WHICH_OVERLOAD(foo, "hello"); // U is void(*)(const char*); // etc. I don't know where I would use such a thing - I'm just curious if it's possible. Barry, sorry for the misunderstanding in my first answer. In the beginning I understood your question in a wrong way. 'T.C.