| 23 | } |
| 24 | |
| 25 | void func(sol::this_state ts) const { |
| 26 | lua_State* L = ts; |
| 27 | // references the object that called this function |
| 28 | // in regular member functions: |
| 29 | sol::stack_object selfobj(L, 1); |
| 30 | // "1" is the bottom of the Lua stack |
| 31 | // 2 is one up, so on and so forth... |
| 32 | thing& self = selfobj.as<thing>(); |
| 33 | |
| 34 | // definitely the same |
| 35 | SOL_ASSERT(&self == this); |
| 36 | } |
| 37 | }; |
| 38 | |
| 39 | sol::state lua; |
nothing calls this directly
no outgoing calls
no test coverage detected