Hello,
Complete AngelScript newbie here. I'm in need of emulating a global function with a std::function. I noticed a brief mention of this in the docs, but couldn't find any example.
Here's what I tried:
function<void(S1)> printFun = [] (S1 s) { print(s);} ;
engine->RegisterGlobalFunction("void print(S1)", asFUNCTION(printFun), asCALL_THISCALL_ASGLOBAL);
And the error was:
(0,0) : ERROR: Failed in call to function 'RegisterGlobalFunction' with 'void print(S1)' (Code: -24)