I have struct:
enum VAR;
typedef void (*VoidF)();
struct Function
{
const char* name;
VAR return_type;
vector<VAR> args;
VoidF f;
};
And I can initialize it like this in VS2013:
const Function funcs[] = {
"print", V_VOID, { V_STRING }, f_print,
"pause", V_VOID, {}, f_pause,
"getstr", V_STRING, {}, f_getstr,
"getint", V_INT, {}, f_getint,
"pow", V_INT, { V_FLOAT, V_FLOAT }, f_pow,
"getfloat", V_FLOAT, {}, f_getfloat
};
But I need this to work in VS2008 too. Is there any other way then changing this to function and pushing vector elements one by one? I have this code on git and it need to work with both versions.
VS2008 don't support features from C++11.