mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
b9115623b2
- Ensure stack field_get/field_set has consistent metaprogramming for needing a pushed table, and at what offset - Avoid duplicate logic in table_core for the same logic by deferring to detail helper - Fixes #1095
12 lines
335 B
C++
12 lines
335 B
C++
#include <sol/sol.hpp>
|
|
|
|
unsigned int regression_1067() {
|
|
sol::state lua;
|
|
|
|
lua.open_libraries(sol::lib::base);
|
|
lua["fct"] = std::function<int()> { []() { return 42; } };
|
|
sol::optional<sol::error> maybe_error = lua.safe_script("assert(fct() == 42)", sol::script_pass_on_error);
|
|
|
|
return maybe_error.has_value() ? 1 : 0;
|
|
}
|