1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-01-31 09:57:14 +01:00

Don't create a variable out of ArgFwd since it's an empty structure used purely for ease of use in specialisations.

This commit is contained in:
Sandu Liviu Catalin 2018-10-31 20:20:09 +02:00
parent 649f04a48c
commit 0e96cc73a9
2 changed files with 9 additions and 18 deletions

View File

@ -46,8 +46,7 @@ namespace Sqrat {
//
template <class R> struct SqGlobalProxy {
template <class... A> static SQInteger Run(HSQUIRRELVM vm, SQInteger idx) {
ArgFwd<A...> a;
a.Call(vm, idx, [](HSQUIRRELVM vm, A... a) {
ArgFwd<A...>{}.Call(vm, idx, [](HSQUIRRELVM vm, A... a) {
typedef R(*M)(A...);
M* method;
sq_getuserdata(vm, -1, reinterpret_cast<SQUserPointer*>(&method), nullptr);
@ -64,8 +63,7 @@ template <class R> struct SqGlobalProxy {
template <class R> struct SqGlobalProxy<R&> {
template <class... A> static SQInteger Run(HSQUIRRELVM vm, SQInteger idx) {
ArgFwd<A...> a;
a.Call(vm, idx, [](HSQUIRRELVM vm, A... a) {
ArgFwd<A...>{}.Call(vm, idx, [](HSQUIRRELVM vm, A... a) {
typedef R&(*M)(A...);
M* method;
sq_getuserdata(vm, -1, reinterpret_cast<SQUserPointer*>(&method), nullptr);
@ -82,8 +80,7 @@ template <class R> struct SqGlobalProxy<R&> {
template <> struct SqGlobalProxy<void> {
template <class... A> static SQInteger Run(HSQUIRRELVM vm, SQInteger idx) {
ArgFwd<A...> a;
a.Call(vm, idx, [](HSQUIRRELVM vm, A... a) {
ArgFwd<A...>{}.Call(vm, idx, [](HSQUIRRELVM vm, A... a) {
typedef void(*M)(A...);
M* method;
sq_getuserdata(vm, -1, reinterpret_cast<SQUserPointer*>(&method), nullptr);

View File

@ -46,8 +46,7 @@ namespace Sqrat {
//
template <class C,class R> struct SqMemberProxy {
template <class... A> static SQInteger Run(HSQUIRRELVM vm) {
ArgFwd<A...> a;
a.Call(vm, 2, [](HSQUIRRELVM vm, A... a) {
ArgFwd<A...>{}.Call(vm, 2, [](HSQUIRRELVM vm, A... a) {
typedef R(C::*M)(A...);
C* inst = Var<C*>(vm, 1).value;
M* methodPtr;
@ -59,8 +58,7 @@ template <class C,class R> struct SqMemberProxy {
return 1;
}
template <class... A> static SQInteger RunC(HSQUIRRELVM vm) {
ArgFwd<A...> a;
a.Call(vm, 2, [](HSQUIRRELVM vm, A... a) {
ArgFwd<A...>{}.Call(vm, 2, [](HSQUIRRELVM vm, A... a) {
typedef R(C::*M)(A...) const;
C* inst = Var<C*>(vm, 1).value;
M* methodPtr;
@ -79,8 +77,7 @@ template <class C,class R> struct SqMemberProxy {
template <class C, class R> struct SqMemberProxy<C,R&> {
template <class... A> static SQInteger Run(HSQUIRRELVM vm) {
ArgFwd<A...> a;
a.Call(vm, 2, [](HSQUIRRELVM vm, A... a) {
ArgFwd<A...>{}.Call(vm, 2, [](HSQUIRRELVM vm, A... a) {
typedef R&(C::*M)(A...);
C* inst = Var<C*>(vm, 1).value;
M* methodPtr;
@ -92,8 +89,7 @@ template <class C, class R> struct SqMemberProxy<C,R&> {
return 1;
}
template <class... A> static SQInteger RunC(HSQUIRRELVM vm) {
ArgFwd<A...> a;
a.Call(vm, 2, [](HSQUIRRELVM vm, A... a) {
ArgFwd<A...>{}.Call(vm, 2, [](HSQUIRRELVM vm, A... a) {
typedef R&(C::*M)(A...) const;
C* inst = Var<C*>(vm, 1).value;
M* methodPtr;
@ -112,8 +108,7 @@ template <class C, class R> struct SqMemberProxy<C,R&> {
template <class C> struct SqMemberProxy<C, void> {
template <class... A> static SQInteger Run(HSQUIRRELVM vm) {
ArgFwd<A...> a;
a.Call(vm, 2, [](HSQUIRRELVM vm, A... a) {
ArgFwd<A...>{}.Call(vm, 2, [](HSQUIRRELVM vm, A... a) {
typedef void(C::*M)(A...);
C* inst = Var<C*>(vm, 1).value;
M* methodPtr;
@ -124,8 +119,7 @@ template <class C> struct SqMemberProxy<C, void> {
return 0;
}
template <class... A> static SQInteger RunC(HSQUIRRELVM vm) {
ArgFwd<A...> a;
a.Call(vm, 2, [](HSQUIRRELVM vm, A... a) {
ArgFwd<A...>{}.Call(vm, 2, [](HSQUIRRELVM vm, A... a) {
typedef void(C::*M)(A...) const;
C* inst = Var<C*>(vm, 1).value;
M* methodPtr;