Explorar o código

Allow NativeFunctions to be pushed onto the stack

Ole %!s(int64=9) %!d(string=hai) anos
pai
achega
272071ccfd
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      lib/luwra/functions.hpp

+ 5 - 0
lib/luwra/functions.hpp

@@ -77,6 +77,11 @@ struct Value<NativeFunction<R>> {
 		luaL_checktype(state, index, LUA_TFUNCTION);
 		return {state, index};
 	}
+
+	static inline
+	size_t push(State* state, const NativeFunction<R>& func) {
+		return Value<Reference>::push(state, func);
+	}
 };
 
 LUWRA_NS_END