利用#define达到函数重载的目的通常和编译选项gcc/g++ -D相关
#define CALL(name) call_##name()
void call_one()
{
cout<<"call_one()"<<endl;
}
void call_two()
{
cout<<"call_two()"<<endl;
}
void call_three()
{
cout<<"call_three()"<<endl;
}
int main()
{
#ifdef CALLFUNCTION
#if (#CALLFUNCTION == "one")
CALL(one);
#elif (#CALLFUNCTION == "two")
CALL(two);
#elif (#CALLFUNCTION == "three")
CALL(three);
#endif
#endif
}
// gcc -DCALLFUNCTION=one
// gcc -DCALLFUNCTION=two
// gcc -DCALLFUNCTION=three