summaryrefslogtreecommitdiffstats
path: root/src/Bindings/LuaState.h
diff options
context:
space:
mode:
authortycho <tycho@localhost>2015-01-31 16:44:14 +0100
committertycho <tycho@localhost>2015-01-31 16:44:14 +0100
commite7424adbf440b70edea14f6aa96029842a9a9a9e (patch)
tree02d249a6d88deb1602985f7179bfaa63907aae5e /src/Bindings/LuaState.h
parentMerge pull request #1713 from mc-server/UseLibevent (diff)
downloadcuberite-e7424adbf440b70edea14f6aa96029842a9a9a9e.tar
cuberite-e7424adbf440b70edea14f6aa96029842a9a9a9e.tar.gz
cuberite-e7424adbf440b70edea14f6aa96029842a9a9a9e.tar.bz2
cuberite-e7424adbf440b70edea14f6aa96029842a9a9a9e.tar.lz
cuberite-e7424adbf440b70edea14f6aa96029842a9a9a9e.tar.xz
cuberite-e7424adbf440b70edea14f6aa96029842a9a9a9e.tar.zst
cuberite-e7424adbf440b70edea14f6aa96029842a9a9a9e.zip
Diffstat (limited to 'src/Bindings/LuaState.h')
-rw-r--r--src/Bindings/LuaState.h16
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))