Sfoglia il codice sorgente

Use 'direct' instead of 'apply'

Ole 10 anni fa
parent
commit
4f319b7720
1 ha cambiato i file con 5 aggiunte e 5 eliminazioni
  1. 5 5
      lib/luwra/functions.hpp

+ 5 - 5
lib/luwra/functions.hpp

@@ -24,20 +24,20 @@ namespace internal {
 
 	template <typename... A>
 	struct FunctionWrapper<void (A...)> {
-		template <void (* function_pointer)(A...)> static inline
+		template <void (* fun)(A...)> static inline
 		int invoke(State* state) {
-			apply(state, function_pointer);
+			direct<void (A...)>(state, fun);
 			return 0;
 		}
 	};
 
 	template <typename R, typename... A>
 	struct FunctionWrapper<R (A...)> {
-		template <R (* function_pointer)(A...)> static inline
+		template <R (* fun)(A...)> static inline
 		int invoke(State* state) {
 			return push(
 				state,
-				apply(state, function_pointer)
+				direct<R (A...)>(state, fun)
 			);
 		}
 	};
@@ -52,7 +52,7 @@ LUWRA_NS_END
 /**
  * Generate a `lua_CFunction` wrapper for a function.
  * \param fun Fully qualified function name (Do not supply a pointer)
- * \return Wrapped function as `lua_CFunction`
+ * \returns Wrapped function as `lua_CFunction`
  */
 #define LUWRA_WRAP_FUNCTION(fun) \
 	(&luwra::internal::FunctionWrapper<decltype(&fun)>::template invoke<&fun>)