From 25ebedbe454c99d2f521e277202be76e6f45aee1 Mon Sep 17 00:00:00 2001 From: worktycho Date: Thu, 16 Oct 2014 15:11:35 +0100 Subject: [PATCH] Use universal references --- src/Bindings/LuaState.h | 8 ++++---- 1 file 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 - 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 - 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 - 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 - 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...);