diff --git a/sqrat/sqrat/sqratClass.h b/sqrat/sqrat/sqratClass.h index 3f67d91c..9096026f 100644 --- a/sqrat/sqrat/sqratClass.h +++ b/sqrat/sqrat/sqratClass.h @@ -410,6 +410,23 @@ public: return *this; } + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// Binds a class function with formatting support + /// + /// \param name Name of the function as it will appear in Squirrel + /// \param method Function to bind + /// + /// \tparam F Type of function (usually doesnt need to be defined explicitly) + /// + /// \return The Class itself so the call can be chained + /// + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + template + Class& CbFunc(const SQChar* name, F method) { + BindFunc(name, &method, sizeof(method), SqMemberFunc(method)); + return *this; + } + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// Binds a class function with overloading enabled /// @@ -465,6 +482,23 @@ public: return *this; } + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// Binds a global function as a class function with formatting support + /// + /// \param name Name of the function as it will appear in Squirrel + /// \param method Function to bind + /// + /// \tparam F Type of function (usually doesnt need to be defined explicitly) + /// + /// \return The Class itself so the call can be chained + /// + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + template + Class& GlobalCbFunc(const SQChar* name, F method) { + BindFunc(name, &method, sizeof(method), SqMemberGlobalFunc(method)); + return *this; + } + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// Binds a static class function /// @@ -499,6 +533,23 @@ public: return *this; } + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + /// Binds a static class function with formatting support + /// + /// \param name Name of the function as it will appear in Squirrel + /// \param method Function to bind + /// + /// \tparam F Type of function (usually doesnt need to be defined explicitly) + /// + /// \return The Class itself so the call can be chained + /// + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + template + Class& StaticCbFunc(const SQChar* name, F method) { + BindFunc(name, &method, sizeof(method), SqGlobalFunc(method)); + return *this; + } + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// Binds a global function as a class function with overloading enabled /// diff --git a/sqrat/sqrat/sqratFunction.h b/sqrat/sqrat/sqratFunction.h index 4e5e427e..10a5e754 100644 --- a/sqrat/sqrat/sqratFunction.h +++ b/sqrat/sqrat/sqratFunction.h @@ -241,7 +241,7 @@ struct Function { SQInteger nparams; SQInteger nfreevars; if (SQ_SUCCEEDED(sq_getclosureinfo(vm, -2, &nparams, &nfreevars)) && - SqGlobalParamInspect< ArgFwd::HASFMT >::Invalid(nparams, ARGC)) { + SqGlobalParamInspect< ArgFwd::HASOPT >::Invalid(nparams, ARGC)) { sq_pop(vm, 2); SQTHROW(vm, _SC("wrong number of parameters")); return SharedPtr(); @@ -281,7 +281,7 @@ struct Function { SQInteger nparams; SQInteger nfreevars; if (SQ_SUCCEEDED(sq_getclosureinfo(vm, -2, &nparams, &nfreevars)) && - SqGlobalParamInspect< ArgFwd::HASFMT >::Invalid(nparams, ARGC)) { + SqGlobalParamInspect< ArgFwd::HASOPT >::Invalid(nparams, ARGC)) { sq_pop(vm, 2); SQTHROW(vm, _SC("wrong number of parameters")); return; @@ -318,6 +318,10 @@ template<> struct Var { // Assumes the Function environment is at index 1. Var(HSQUIRRELVM vm, SQInteger idx) : value(vm, idx) { } + // Attempts to get the value off the stack at idx as a Function + // Assumes the Function environment is at index 1. + Var(HSQUIRRELVM vm, SQInteger idx1, SQInteger idx2) : value(vm, idx1, idx2) { + } // Called by Sqrat::PushVar to put a Function on the stack static void push(HSQUIRRELVM vm, const Function& value) { sq_pushobject(vm, value.GetFunc()); @@ -328,12 +332,31 @@ template<> struct Var : public Var { Var(HSQUIRRELVM vm, SQInteger idx) : Var(vm, idx) { } + Var(HSQUIRRELVM vm, SQInteger idx1, SQInteger idx2) : Var(vm, idx1, idx2) + { + } }; // Used to get and push Function instances to and from the stack as references (functions are always references in Squirrel) template<> struct Var : public Var { Var(HSQUIRRELVM vm, SQInteger idx) : Var(vm, idx) { } + Var(HSQUIRRELVM vm, SQInteger idx1, SQInteger idx2) : Var(vm, idx1, idx2) + { + } +}; + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/// Helper used to process callback arguments when necessary. +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +template<> struct ArgFwdOptVar : public Var { + ArgFwdOptVar(HSQUIRRELVM vm, SQInteger idx) : Var(vm, idx, idx+1) {} +}; +template<> struct ArgFwdOptVar : public Var { + ArgFwdOptVar(HSQUIRRELVM vm, SQInteger idx) : Var(vm, idx, idx+1) {} +}; +template<> struct ArgFwdOptVar : public Var { + ArgFwdOptVar(HSQUIRRELVM vm, SQInteger idx) : Var(vm, idx, idx+1) {} }; } diff --git a/sqrat/sqrat/sqratGlobalMethods.h b/sqrat/sqrat/sqratGlobalMethods.h index 742e5831..77eb0511 100644 --- a/sqrat/sqrat/sqratGlobalMethods.h +++ b/sqrat/sqrat/sqratGlobalMethods.h @@ -121,7 +121,7 @@ template struct SqGlobal { return +[](HSQUIRRELVM vm) -> SQInteger { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && - SqGlobalParamCheck< ArgFwd::HASFMT >::Invalid(sq_gettop(vm), startIdx + sizeof...(A))) { + SqGlobalParamCheck< ArgFwd::HASOPT >::Invalid(sq_gettop(vm), startIdx + sizeof...(A))) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif @@ -147,7 +147,7 @@ template struct SqGlobal { return +[](HSQUIRRELVM vm) -> SQInteger { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && - SqGlobalParamCheck< ArgFwd::HASFMT >::Invalid(sq_gettop(vm), startIdx + sizeof...(A))) { + SqGlobalParamCheck< ArgFwd::HASOPT >::Invalid(sq_gettop(vm), startIdx + sizeof...(A))) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif @@ -173,7 +173,7 @@ template <> struct SqGlobal { return +[](HSQUIRRELVM vm) -> SQInteger { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && - SqGlobalParamCheck< ArgFwd::HASFMT >::Invalid(sq_gettop(vm), startIdx + sizeof...(A))) { + SqGlobalParamCheck< ArgFwd::HASOPT >::Invalid(sq_gettop(vm), startIdx + sizeof...(A))) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif diff --git a/sqrat/sqrat/sqratMemberMethods.h b/sqrat/sqrat/sqratMemberMethods.h index f73c38f3..0c854677 100644 --- a/sqrat/sqrat/sqratMemberMethods.h +++ b/sqrat/sqrat/sqratMemberMethods.h @@ -151,7 +151,7 @@ template struct SqMember { return +[](HSQUIRRELVM vm) -> SQInteger { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && - SqGlobalParamCheck< ArgFwd::HASFMT >::Invalid(sq_gettop(vm), 2 + sizeof...(A))) { + SqGlobalParamCheck< ArgFwd::HASOPT >::Invalid(sq_gettop(vm), 2 + sizeof...(A))) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif @@ -170,7 +170,7 @@ template struct SqMember { return +[](HSQUIRRELVM vm) -> SQInteger { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && - SqGlobalParamCheck< ArgFwd::HASFMT >::Invalid(sq_gettop(vm), 2 + sizeof...(A))) { + SqGlobalParamCheck< ArgFwd::HASOPT >::Invalid(sq_gettop(vm), 2 + sizeof...(A))) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif @@ -196,7 +196,7 @@ template struct SqMember { return +[](HSQUIRRELVM vm) -> SQInteger { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && - SqGlobalParamCheck< ArgFwd::HASFMT >::Invalid(sq_gettop(vm), 2 + sizeof...(A))) { + SqGlobalParamCheck< ArgFwd::HASOPT >::Invalid(sq_gettop(vm), 2 + sizeof...(A))) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif @@ -215,7 +215,7 @@ template struct SqMember { return +[](HSQUIRRELVM vm) -> SQInteger { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && - SqGlobalParamCheck< ArgFwd::HASFMT >::Invalid(sq_gettop(vm), 2 + sizeof...(A))) { + SqGlobalParamCheck< ArgFwd::HASOPT >::Invalid(sq_gettop(vm), 2 + sizeof...(A))) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif @@ -242,7 +242,7 @@ template struct SqMember { return +[](HSQUIRRELVM vm) -> SQInteger { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && - SqGlobalParamCheck< ArgFwd::HASFMT >::Invalid(sq_gettop(vm), 2 + sizeof...(A))) { + SqGlobalParamCheck< ArgFwd::HASOPT >::Invalid(sq_gettop(vm), 2 + sizeof...(A))) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif @@ -261,7 +261,7 @@ template struct SqMember { return +[](HSQUIRRELVM vm) -> SQInteger { #if !defined (SCRAT_NO_ERROR_CHECKING) if (!SQRAT_CONST_CONDITION(overloaded) && - SqGlobalParamCheck< ArgFwd::HASFMT >::Invalid(sq_gettop(vm), 2 + sizeof...(A))) { + SqGlobalParamCheck< ArgFwd::HASOPT >::Invalid(sq_gettop(vm), 2 + sizeof...(A))) { return sq_throwerror(vm, _SC("wrong number of parameters")); } #endif diff --git a/sqrat/sqrat/sqratTypes.h b/sqrat/sqrat/sqratTypes.h index b3a09a21..810f0ad7 100644 --- a/sqrat/sqrat/sqratTypes.h +++ b/sqrat/sqrat/sqratTypes.h @@ -1228,23 +1228,48 @@ inline void PushVarR(HSQUIRRELVM vm, T& value) { } } +// Forward declaration +struct Function; + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -/// Helper used to process formatted arguments when necessary. +/// Helper used to identify optional arguments when necessary. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -template struct ArgFwdHasFmt { static constexpr bool value = false; }; -template<> struct ArgFwdHasFmt { static constexpr bool value = true; }; -template<> struct ArgFwdHasFmt { static constexpr bool value = true; }; -template<> struct ArgFwdHasFmt { static constexpr bool value = true; }; -template<> struct ArgFwdHasFmt { static constexpr bool value = true; }; +template struct ArgFwdHasOpt { static constexpr bool value = false; }; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// Helper used to process formatted arguments when necessary. ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -template struct ArgFwdFmtVar : Var { - ArgFwdFmtVar(HSQUIRRELVM vm, SQInteger idx) : Var(vm, idx) {} +template<> struct ArgFwdHasOpt { static constexpr bool value = true; }; +template<> struct ArgFwdHasOpt { static constexpr bool value = true; }; +template<> struct ArgFwdHasOpt { static constexpr bool value = true; }; +template<> struct ArgFwdHasOpt { static constexpr bool value = true; }; + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/// Helper used to process callback arguments when necessary. +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +template<> struct ArgFwdHasOpt { static constexpr bool value = true; }; +template<> struct ArgFwdHasOpt { static constexpr bool value = true; }; +template<> struct ArgFwdHasOpt { static constexpr bool value = true; }; +template<> struct ArgFwdHasOpt { static constexpr bool value = true; }; + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/// Helper used to process optional arguments when necessary. +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +template struct ArgFwdOptVar : public Var { + ArgFwdOptVar(HSQUIRRELVM vm, SQInteger idx) : Var(vm, idx) {} }; -template struct ArgFwdFmtVar : Var { - ArgFwdFmtVar(HSQUIRRELVM vm, SQInteger idx) : Var(vm, idx, true, Var::DropFuncPtr) {} + +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/// Helper used to process formatted arguments when necessary. +///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +template<> struct ArgFwdOptVar : public Var { + ArgFwdOptVar(HSQUIRRELVM vm, SQInteger idx) : Var(vm, idx, true, Var::DropFuncPtr) {} +}; +template<> struct ArgFwdOptVar : public Var { + ArgFwdOptVar(HSQUIRRELVM vm, SQInteger idx) : Var(vm, idx, true, Var::DropFuncPtr) {} +}; +template<> struct ArgFwdOptVar : public Var { + ArgFwdOptVar(HSQUIRRELVM vm, SQInteger idx) : Var(vm, idx, true, Var::DropFuncPtr) {} }; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1263,7 +1288,7 @@ template struct ArgFwd; template<> struct ArgFwd<> { // Used to tell whether the last template parameter is a StackStrF type - static constexpr bool HASFMT = false; + static constexpr bool HASOPT = false; // Forward the arguments to a function object template inline auto Call(HSQUIRRELVM vm, SQInteger /*idx*/, F f) { return f(vm); @@ -1276,10 +1301,10 @@ struct ArgFwd<> { template struct ArgFwd { // Used to tell whether the last template parameter is a StackStrF type - static constexpr bool HASFMT = ArgFwdHasFmt::value; + static constexpr bool HASOPT = ArgFwdHasOpt::value; // Forward the arguments to a function object template inline auto Call(HSQUIRRELVM vm, SQInteger idx, F f) { - ArgFwdFmtVar a1(vm, idx); + ArgFwdOptVar a1(vm, idx); return f(vm,a1.value); } }; @@ -1287,11 +1312,11 @@ struct ArgFwd { template struct ArgFwd { // Used to tell whether the last template parameter is a StackStrF type - static constexpr bool HASFMT = ArgFwdHasFmt::value; + static constexpr bool HASOPT = ArgFwdHasOpt::value; // Forward the arguments to a function object template inline auto Call(HSQUIRRELVM vm, SQInteger idx, F f) { Var a1(vm, idx++); - ArgFwdFmtVar a2(vm, idx); + ArgFwdOptVar a2(vm, idx); return f(vm,a1.value,a2.value); } }; @@ -1299,12 +1324,12 @@ struct ArgFwd { template struct ArgFwd { // Used to tell whether the last template parameter is a StackStrF type - static constexpr bool HASFMT = ArgFwdHasFmt::value; + static constexpr bool HASOPT = ArgFwdHasOpt::value; // Forward the arguments to a function object template inline auto Call(HSQUIRRELVM vm, SQInteger idx, F f) { Var a1(vm, idx++); Var a2(vm, idx++); - ArgFwdFmtVar a3(vm, idx); + ArgFwdOptVar a3(vm, idx); return f(vm,a1.value,a2.value,a3.value); } }; @@ -1313,13 +1338,13 @@ struct ArgFwd { template struct ArgFwd { // Used to tell whether the last template parameter is a StackStrF type - static constexpr bool HASFMT = ArgFwdHasFmt::value; + static constexpr bool HASOPT = ArgFwdHasOpt::value; // Forward the arguments to a function object template inline auto Call(HSQUIRRELVM vm, SQInteger idx, F f) { Var a1(vm, idx++); Var a2(vm, idx++); Var a3(vm, idx++); - ArgFwdFmtVar a4(vm, idx); + ArgFwdOptVar a4(vm, idx); return f(vm,a1.value,a2.value,a3.value,a4.value); } }; @@ -1327,14 +1352,14 @@ struct ArgFwd { template struct ArgFwd { // Used to tell whether the last template parameter is a StackStrF type - static constexpr bool HASFMT = ArgFwdHasFmt::value; + static constexpr bool HASOPT = ArgFwdHasOpt::value; // Forward the arguments to a function object template inline auto Call(HSQUIRRELVM vm, SQInteger idx, F f) { Var a1(vm, idx++); Var a2(vm, idx++); Var a3(vm, idx++); Var a4(vm, idx++); - ArgFwdFmtVar a5(vm, idx); + ArgFwdOptVar a5(vm, idx); return f(vm,a1.value,a2.value,a3.value,a4.value,a5.value); } }; @@ -1342,7 +1367,7 @@ struct ArgFwd { template struct ArgFwd { // Used to tell whether the last template parameter is a StackStrF type - static constexpr bool HASFMT = ArgFwdHasFmt::value; + static constexpr bool HASOPT = ArgFwdHasOpt::value; // Forward the arguments to a function object template inline auto Call(HSQUIRRELVM vm, SQInteger idx, F f) { Var a1(vm, idx++); @@ -1350,7 +1375,7 @@ struct ArgFwd { Var a3(vm, idx++); Var a4(vm, idx++); Var a5(vm, idx++); - ArgFwdFmtVar a6(vm, idx); + ArgFwdOptVar a6(vm, idx); return f(vm,a1.value,a2.value,a3.value,a4.value,a5.value,a6.value); } }; @@ -1358,7 +1383,7 @@ struct ArgFwd { template struct ArgFwd { // Used to tell whether the last template parameter is a StackStrF type - static constexpr bool HASFMT = ArgFwdHasFmt::value; + static constexpr bool HASOPT = ArgFwdHasOpt::value; // Forward the arguments to a function object template inline auto Call(HSQUIRRELVM vm, SQInteger idx, F f) { Var a1(vm, idx++); @@ -1367,7 +1392,7 @@ struct ArgFwd { Var a4(vm, idx++); Var a5(vm, idx++); Var a6(vm, idx++); - ArgFwdFmtVar a7(vm, idx); + ArgFwdOptVar a7(vm, idx); return f(vm,a1.value,a2.value,a3.value,a4.value,a5.value,a6.value,a7.value); } }; @@ -1375,7 +1400,7 @@ struct ArgFwd { template struct ArgFwd { // Used to tell whether the last template parameter is a StackStrF type - static constexpr bool HASFMT = ArgFwdHasFmt::value; + static constexpr bool HASOPT = ArgFwdHasOpt::value; // Forward the arguments to a function object template inline auto Call(HSQUIRRELVM vm, SQInteger idx, F f) { Var a1(vm, idx++); @@ -1385,7 +1410,7 @@ struct ArgFwd { Var a5(vm, idx++); Var a6(vm, idx++); Var a7(vm, idx++); - ArgFwdFmtVar a8(vm, idx); + ArgFwdOptVar a8(vm, idx); return f(vm,a1.value,a2.value,a3.value,a4.value,a5.value,a6.value,a7.value,a8.value); } }; @@ -1393,7 +1418,7 @@ struct ArgFwd { template struct ArgFwd { // Used to tell whether the last template parameter is a StackStrF type - static constexpr bool HASFMT = ArgFwdHasFmt::value; + static constexpr bool HASOPT = ArgFwdHasOpt::value; // Forward the arguments to a function object template inline auto Call(HSQUIRRELVM vm, SQInteger idx, F f) { Var a1(vm, idx++); @@ -1404,7 +1429,7 @@ struct ArgFwd { Var a6(vm, idx++); Var a7(vm, idx++); Var a8(vm, idx++); - ArgFwdFmtVar a9(vm, idx); + ArgFwdOptVar a9(vm, idx); return f(vm,a1.value,a2.value,a3.value,a4.value,a5.value,a6.value,a7.value,a8.value,a9.value); } }; @@ -1412,7 +1437,7 @@ struct ArgFwd { template struct ArgFwd { // Used to tell whether the last template parameter is a StackStrF type - static constexpr bool HASFMT = ArgFwdHasFmt::value; + static constexpr bool HASOPT = ArgFwdHasOpt::value; // Forward the arguments to a function object template inline auto Call(HSQUIRRELVM vm, SQInteger idx, F f) { Var a1(vm, idx++); @@ -1424,7 +1449,7 @@ struct ArgFwd { Var a7(vm, idx++); Var a8(vm, idx++); Var a9(vm, idx++); - ArgFwdFmtVar a10(vm, idx); + ArgFwdOptVar a10(vm, idx); return f(vm,a1.value,a2.value,a3.value,a4.value,a5.value,a6.value,a7.value,a8.value,a9.value,a10.value); } }; @@ -1432,7 +1457,7 @@ struct ArgFwd { template struct ArgFwd { // Used to tell whether the last template parameter is a StackStrF type - static constexpr bool HASFMT = ArgFwdHasFmt::value; + static constexpr bool HASOPT = ArgFwdHasOpt::value; // Forward the arguments to a function object template inline auto Call(HSQUIRRELVM vm, SQInteger idx, F f) { Var a1(vm, idx++); @@ -1445,7 +1470,7 @@ struct ArgFwd { Var a8(vm, idx++); Var a9(vm, idx++); Var a10(vm, idx++); - ArgFwdFmtVar a11(vm, idx); + ArgFwdOptVar a11(vm, idx); return f(vm,a1.value,a2.value,a3.value,a4.value,a5.value,a6.value,a7.value,a8.value,a9.value,a10.value,a11.value); } }; @@ -1453,7 +1478,7 @@ struct ArgFwd { template struct ArgFwd { // Used to tell whether the last template parameter is a StackStrF type - static constexpr bool HASFMT = ArgFwdHasFmt::value; + static constexpr bool HASOPT = ArgFwdHasOpt::value; // Forward the arguments to a function object template inline auto Call(HSQUIRRELVM vm, SQInteger idx, F f) { Var a1(vm, idx++); @@ -1467,7 +1492,7 @@ struct ArgFwd { Var a9(vm, idx++); Var a10(vm, idx++); Var a11(vm, idx++); - ArgFwdFmtVar a12(vm, idx); + ArgFwdOptVar a12(vm, idx); return f(vm,a1.value,a2.value,a3.value,a4.value,a5.value,a6.value,a7.value,a8.value,a9.value,a10.value,a11.value,a12.value); } }; @@ -1475,7 +1500,7 @@ struct ArgFwd { template struct ArgFwd { // Used to tell whether the last template parameter is a StackStrF type - static constexpr bool HASFMT = ArgFwdHasFmt::value; + static constexpr bool HASOPT = ArgFwdHasOpt::value; // Forward the arguments to a function object template inline auto Call(HSQUIRRELVM vm, SQInteger idx, F f) { Var a1(vm, idx++); @@ -1490,7 +1515,7 @@ struct ArgFwd { Var a10(vm, idx++); Var a11(vm, idx++); Var a12(vm, idx++); - ArgFwdFmtVar a13(vm, idx); + ArgFwdOptVar a13(vm, idx); return f(vm,a1.value,a2.value,a3.value,a4.value,a5.value,a6.value,a7.value,a8.value,a9.value,a10.value,a11.value,a12.value,a13.value); } }; @@ -1498,7 +1523,7 @@ struct ArgFwd { template struct ArgFwd { // Used to tell whether the last template parameter is a StackStrF type - static constexpr bool HASFMT = ArgFwdHasFmt::value; + static constexpr bool HASOPT = ArgFwdHasOpt::value; // Forward the arguments to a function object template inline auto Call(HSQUIRRELVM vm, SQInteger idx, F f) { Var a1(vm, idx++); @@ -1514,7 +1539,7 @@ struct ArgFwd { Var a11(vm, idx++); Var a12(vm, idx++); Var a13(vm, idx++); - ArgFwdFmtVar a14(vm, idx); + ArgFwdOptVar a14(vm, idx); return f(vm,a1.value,a2.value,a3.value,a4.value,a5.value,a6.value,a7.value,a8.value,a9.value,a10.value,a11.value,a12.value,a13.value,a14.value); } };