Just to clarify: PushVarR exists to force something to be a reference even when its not, while PushVar can do copies and references
Just to clarify: PushVarR exists to force something to be a reference even when its not
Replaced Sqrat::PushVar to Sqrat::PushVarR in Sqrat::Function Evaluate/Execute methods.
Glad it works!
Make sure you are calling Evaluate/Execute with the correct template typenames. Do not let the compiler guess the argument types for you
Make sure you are calling Evaluate/Execute with the correct templates. Do not let the compiler guess them for you
If the current way doesn't work (verifiable using a debugger and some breakpoints to see if its triggering the correct code) and can't be made to work, then I'd be willing to accept this change as long as it doesn't have unforeseen consequences. It looks like it would force everything to be references always, which would definitely cause issues.
Not that it was thoroughly tested, but notice how in sqratTypes.h there are overloads for references, pointers, and even SharedPtr that all use PushInstance rather than PushInstanceCopy. If the template magic is happening correctly, then this should be happening already.