Certain situations in my code, i end up invoking the function only if that function is defined, or else i should not. How can i achieve this ?
like: if (func
use pointers to functions.
//initialize typedef void (*PF)(); std::map defined_functions; defined_functions["foo"]=&foo; defined_functions["bar"]=&bar; //if defined, invoke it if(defined_functions.find("foo") != defined_functions.end()) { defined_functions["foo"](); }