diff options
author | worktycho <work.tycho@gmail.com> | 2014-10-16 16:11:35 +0200 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2014-10-16 16:11:35 +0200 |
commit | 25ebedbe454c99d2f521e277202be76e6f45aee1 (patch) | |
tree | 5d29059f2e1a293803076611858db676dc83ebbe /src/Bindings/LuaState.h | |
parent | cLuaState::Call() uses variadic templates. (diff) | |
download | cuberite-25ebedbe454c99d2f521e277202be76e6f45aee1.tar cuberite-25ebedbe454c99d2f521e277202be76e6f45aee1.tar.gz cuberite-25ebedbe454c99d2f521e277202be76e6f45aee1.tar.bz2 cuberite-25ebedbe454c99d2f521e277202be76e6f45aee1.tar.lz cuberite-25ebedbe454c99d2f521e277202be76e6f45aee1.tar.xz cuberite-25ebedbe454c99d2f521e277202be76e6f45aee1.tar.zst cuberite-25ebedbe454c99d2f521e277202be76e6f45aee1.zip |
Diffstat (limited to 'src/Bindings/LuaState.h')
-rw-r--r-- | src/Bindings/LuaState.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Bindings/LuaState.h b/src/Bindings/LuaState.h index b703959e0..779760017 100644 --- a/src/Bindings/LuaState.h +++ b/src/Bindings/LuaState.h @@ -245,7 +245,7 @@ public: A special param of cRet & signifies the end of param list and the start of return values. Example call: Call(Fn, Param1, Param2, Param3, cLuaState::Return, Ret1, Ret2) */ template <typename FnT, typename... Args> - bool Call(const FnT & a_Function, Args &... args) + bool Call(const FnT & a_Function, Args &&... args) { PushFunction(a_Function); return PushCallPop(args...); @@ -253,7 +253,7 @@ public: /** Retrieves a list of values from the Lua stack, starting at the specified index. */ template <typename T, typename... Args> - inline void GetStackValues(int a_StartStackPos, T & a_Ret, Args &... args) + inline void GetStackValues(int a_StartStackPos, T & a_Ret, Args &&... args) { GetStackValue(a_StartStackPos, a_Ret); GetStackValues(a_StartStackPos + 1, args...); @@ -364,7 +364,7 @@ protected: /** Variadic template recursor: More params to push. Push them and recurse. */ template<typename T, typename... Args> - inline bool PushCallPop(T a_Param, Args &... args) + inline bool PushCallPop(T a_Param, Args &&... args) { Push(a_Param); return PushCallPop(args...); @@ -372,7 +372,7 @@ protected: /** Variadic template terminator: If there's nothing more to push, but return values to collect, call the function and collect the returns. */ template <typename... Args> - bool PushCallPop(cLuaState::cRet, Args &... args) + bool PushCallPop(cLuaState::cRet, Args &&... args) { // Calculate the number of return values (number of args left): int NumReturns = CountArgs(args...); |