mirror of
https://github.com/ThePhD/sol2.git
synced 2024-03-22 13:10:44 +08:00
d39330eab9
- add noexcept to some of the core function calls - type usage for both trampolines and yields can now be fully tracked, at the expense of more template instantiations when using both - exceptions should be less prone to explosion in C versions, but will break in C++ code (the trampolines need to be modified for usertype calls to avoid this problem, specifically)
12 lines
292 B
C++
12 lines
292 B
C++
#include <sol/sol.hpp>
|
|
|
|
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("print(fct())");
|
|
|
|
return maybe_error.has_value() ? 1 : 0;
|
|
}
|