2020-09-26 18:47:20 +08:00
|
|
|
#include <sol/sol.hpp>
|
|
|
|
|
2020-12-30 10:50:16 +08:00
|
|
|
inline namespace sol2_regression_test_1000 {
|
|
|
|
struct foo {
|
|
|
|
static void register_into(sol::table& table) {
|
|
|
|
table.new_usertype<foo>("foo", "id", sol::readonly(&foo::id));
|
|
|
|
}
|
|
|
|
int id;
|
|
|
|
};
|
|
|
|
} // namespace sol2_regression_test_1000
|
2020-09-26 18:47:20 +08:00
|
|
|
|
2020-12-30 10:50:16 +08:00
|
|
|
unsigned int regression_1000() {
|
2020-09-26 18:47:20 +08:00
|
|
|
sol::state lua;
|
|
|
|
lua.create_named_table("t");
|
|
|
|
|
|
|
|
sol::table t = lua["t"];
|
2020-12-30 10:50:16 +08:00
|
|
|
foo::register_into(t);
|
2020-09-26 18:47:20 +08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|