| 166 | } |
| 167 | |
| 168 | int main() { |
| 169 | |
| 170 | std::cout << "=== metatable with custom-built (static) " |
| 171 | "handling ===" |
| 172 | << std::endl; |
| 173 | |
| 174 | |
| 175 | sol::state lua; |
| 176 | lua.open_libraries(sol::lib::base); |
| 177 | |
| 178 | // register custom type + storage |
| 179 | register_thing_type(lua); |
| 180 | |
| 181 | lua.script(R"(t = thing.new() |
| 182 | print(t.member_variable) |
| 183 | print(t:member_function()) |
| 184 | t.member_variable = 24 |
| 185 | print(t.member_variable) |
| 186 | print(t:member_function()) |
| 187 | )"); |
| 188 | |
| 189 | // clear storage |
| 190 | unregister_thing_type(lua); |
| 191 | |
| 192 | std::cout << std::endl; |
| 193 | |
| 194 | return 0; |
| 195 | } |
nothing calls this directly
no test coverage detected