C#:
#define CALL_FUNCTION(_function, _checkFor) \
{ \
writeln("Calling %s", #_call); \
int res = _function; \
if(res != (_checkFor)) \
{ \
std::stringstream msg; \
writeln("%s returned error %d", #_function, res); \
} \
}
Not that each function can have different arguments. So I think delegates don't work. Also note that there is actually more going on in the #define but the goal is to do one-liners instead of repeating the same code again and again.
Last edited by a moderator: