Ordering issues make me sad.

This commit is contained in:
ThePhD 2016-05-03 15:17:14 -04:00
parent 27a8dde1e6
commit 2aa5ab77a8
2 changed files with 4 additions and 4 deletions

View File

@ -70,7 +70,7 @@ public:
};
inline bool operator== (const stack_reference& l, const stack_reference& r) {
return lua_compare(l.lua_state(), l.stack_index(), l.stack_index(), LUA_OPEQ) == 0;
return lua_compare(l.lua_state(), l.stack_index(), r.stack_index(), LUA_OPEQ) == 0;
}
inline bool operator!= (const stack_reference& l, const stack_reference& r) {

View File

@ -268,7 +268,7 @@ private:
}
template<std::size_t N>
void build_function(std::string funcname, no_construction) {}
void build_function(std::string, no_construction) {}
template<std::size_t N, typename... Args>
void build_function(std::string funcname, constructors<Args...>) {
@ -499,8 +499,8 @@ public:
// be sure to link the construction function to allow for people to do the whole lua_bind thing
if (constructfunc != nullptr && constructfuncname != nullptr && std::find(meta_function_names.cbegin(), meta_function_names.cend(), constructfuncname) != meta_function_names.cend()) {
lua_createtable(L, 0, 0);
sol::stack_table mt(L, -1);
mt[constructfuncname] = constructfunc;
lua_pushcclosure(L, constructfunc, 0);
lua_setfield(L, -2, constructfuncname);
lua_setmetatable(L, -2);
}
// Make sure to drop a table in the global namespace to properly destroy the pushed functions