This commit is contained in:
2026-04-05 02:30:23 +08:00
parent 1dc5fa6d48
commit b7f8b92fe9
526 changed files with 28920 additions and 67070 deletions
-21
View File
@@ -1,21 +0,0 @@
#define SOL_ALL_SAFETIES_ON 1
#include <sol/sol.hpp>
int main() {
struct callable {
int operator()(int a, bool b) {
return a + (b ? 10 : 20);
}
};
sol::state lua;
// Binds struct as userdata
// can still be callable, but beware
// caveats
lua.set("not_func", callable());
// Binds struct as function
lua.set("func", sol::as_function(callable()));
// equivalent: lua.set_function( "func", callable() );
// equivalent: lua["func"] = callable();
}