Get rid of getfield/setfield

This commit is contained in:
2021-02-10 16:47:45 -05:00
parent 3883f86dee
commit eefe1bd58a
5 changed files with 63 additions and 61 deletions

View File

@@ -504,17 +504,17 @@ public:
lua_rawset(L_, tab);
}
template<typename VT>
void setfield(LuaSlot tab, const char *field, VT value) const {
push_any_value(value);
lua_setfield(L_, tab, field);
}
// template<typename VT>
// void rawset(LuaSlot tab, const char *field, VT value) const {
// push_any_value(value);
// lua_rawset(L_, tab, field);
// }
template<typename RT>
void getfield(RT &target, LuaSlot tab, const char *field) const {
lua_getfield(L_, tab, field);
pop_any_value(target);
}
// template<typename RT>
// void rawget(RT &target, LuaSlot tab, const char *field) const {
// lua_rawget(L_, tab, field);
// pop_any_value(target);
// }
// Call invokes any C function. It pushes the arguments on the stack,
// calls the cfunction, verifies that the number of return values is as