diff options
author | Howaner <franzi.moos@googlemail.com> | 2015-02-06 21:52:14 +0100 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2015-02-06 21:52:14 +0100 |
commit | 2c7925f0adc17d7680ff9791832ab2c349c2301f (patch) | |
tree | ef6233b0d9dece6f7520996f2a4d850470e2c2d3 /src/Bindings/LuaState.h | |
parent | Readded old DistributeStackToAreas() comment. (diff) | |
parent | Switched LuaState to use sizeof... (diff) | |
download | cuberite-2c7925f0adc17d7680ff9791832ab2c349c2301f.tar cuberite-2c7925f0adc17d7680ff9791832ab2c349c2301f.tar.gz cuberite-2c7925f0adc17d7680ff9791832ab2c349c2301f.tar.bz2 cuberite-2c7925f0adc17d7680ff9791832ab2c349c2301f.tar.lz cuberite-2c7925f0adc17d7680ff9791832ab2c349c2301f.tar.xz cuberite-2c7925f0adc17d7680ff9791832ab2c349c2301f.tar.zst cuberite-2c7925f0adc17d7680ff9791832ab2c349c2301f.zip |
Diffstat (limited to 'src/Bindings/LuaState.h')
-rw-r--r-- | src/Bindings/LuaState.h | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/Bindings/LuaState.h b/src/Bindings/LuaState.h index 7ac4120e1..97e6b47e1 100644 --- a/src/Bindings/LuaState.h +++ b/src/Bindings/LuaState.h @@ -346,20 +346,6 @@ protected: /** Number of arguments currently pushed (for the Push / Call chain) */ int m_NumCurrentFunctionArgs; - - /** Variadic template terminator: Counting zero args returns zero. */ - int CountArgs(void) - { - return 0; - } - - /** Variadic template: Counting args means add one to the count of the rest. */ - template <typename T, typename... Args> - int CountArgs(T, Args... args) - { - return 1 + CountArgs(args...); - } - /** Variadic template terminator: If there's nothing more to push / pop, just call the function. Note that there are no return values either, because those are prefixed by a cRet value, so the arg list is never empty. */ bool PushCallPop(void) @@ -380,7 +366,7 @@ protected: bool PushCallPop(cLuaState::cRet, Args &&... args) { // Calculate the number of return values (number of args left): - int NumReturns = CountArgs(args...); + int NumReturns = sizeof...(args); // Call the function: if (!CallFunction(NumReturns)) |