Having read the question from Is it possible to write a C++ template to check for a function's existence?, and tested a few of the answers, I find it only works on detecting functions that take no parameters, EG void HelloWord(). Searching around for answers either just gives solutions to parameterless functions or eye-wateringly complex solutions that I can't make head nor tail of.
Here's my macro template code for constructing detectors:
#define MEMBERFUNCTIONTODETECT(CONTAINS_NAME,MEMBERFUNCTION) \
template <typename TemplateItem>\
class CONTAINS_NAME\
{\
typedef char Yes;\
typedef char No[2];\
\
template <typename TemplateClass> static Yes &Test( decltype(&TemplateClass::MEMBERFUNCTION) );\
template <typename TemplateClass> static No &Test(...);\
\
public:\
enum { Value = sizeof(Test<TemplateItem>(0)) == sizeof(char) };\
};
How do I modify the above code in order to detect a member function in a class, that contains parameters, EG void SetPosition(float,float)?
I'm willing to accept solutions that are total rewrites, but if any solutions are more complex than the above, please try to explain what is happening in as much depth as possible so I (and presumably others) can understand how it works. Treat me like I have no idea what anything of what you wrote means.