sol2/tests/regression_tests/simple/source/1000 - readonly warning.cpp
ThePhD b9115623b2
Overhaul stack_field tableless handlers
- 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
2020-12-29 21:50:16 -05:00

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;
}