We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler: g++ (GCC) 14.2.1 20240805
Using sol::policies around sol::overload results in the function arguments missing from the stack when it gets to the policy function.
sol::policies
sol::overload
Using sol::overload around sol::policies results in a runtime error from the function resolution failing.
#define SOL_ALL_SAFETIES_ON 1 #include <sol/sol.hpp> struct CppObject {}; void overload1(CppObject&) {} void overload2(CppObject&, int) {} int main() { sol::state lua; lua.open_libraries(sol::lib::base); CppObject x; lua["x"] = &x; lua["overload1"] = sol::policies(overload1, sol::returns_self()); lua["overload2"] = sol::policies(overload2, sol::returns_self()); lua["policies_overload"] = sol::policies( sol::overload( overload1, overload2 ), sol::returns_self()); lua["overload_policies"] = sol::overload( sol::policies(overload1, sol::returns_self()), sol::policies(overload2, sol::returns_self()) ); // good lua.script("print(overload1(x))"); // good lua.script("print(overload2(x, 10))"); // nil lua.script("print(policies_overload(x))"); // sol: no matching function call takes this number of arguments and the specified types lua.script("print(overload_policies(x))"); return 0; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Compiler: g++ (GCC) 14.2.1 20240805
Using
sol::policies
aroundsol::overload
results in the function arguments missing from the stack when it gets to the policy function.Using
sol::overload
aroundsol::policies
results in a runtime error from the function resolution failing.The text was updated successfully, but these errors were encountered: