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
21 lines
423 B
C++
21 lines
423 B
C++
#include <sol/sol.hpp>
|
|
|
|
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
|
|
|
|
unsigned int regression_1000() {
|
|
sol::state lua;
|
|
lua.create_named_table("t");
|
|
|
|
sol::table t = lua["t"];
|
|
foo::register_into(t);
|
|
|
|
return 0;
|
|
}
|