diff --git a/include/sqrat/sqratTypes.h b/include/sqrat/sqratTypes.h index 599980ad..b9c6b5ad 100644 --- a/include/sqrat/sqratTypes.h +++ b/include/sqrat/sqratTypes.h @@ -1021,7 +1021,7 @@ public: #endif ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -/// Used to get and push StackStrF types to and from the stack +/// Used to get and push StackStrF types to and from the stack (StackStrF is always a reference) ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template<> struct Var { @@ -1055,39 +1055,10 @@ struct Var { }; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -/// Used to get and push StackStrF types to and from the stack +/// Used to get and push StackStrF types to and from the stack (StackStrF is always a reference) ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// template<> -struct Var { - - StackStrF value; ///< The actual value of get operations - - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// Attempts to get the value off the stack at idx as a string - /// - /// \param vm Target VM - /// \param idx Index trying to be read - /// - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - Var(HSQUIRRELVM vm, SQInteger idx) : value(vm, idx, false) { - } - - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /// Called by Sqrat::PushVar to put a string on the stack - /// - /// \param vm Target VM - /// \param value Value to push on to the VM's stack - /// - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - static void push(HSQUIRRELVM vm, const StackStrF& value) { - if (sq_isstring(value.mObj)) { - sq_pushobject(vm, value.mObj); - } else { - sq_pushstring(vm, value.mPtr, value.mLen); - } - } -}; - +struct Var : Var {Var(HSQUIRRELVM vm, SQInteger idx) : Var(vm, idx) {}}; // Non-referencable type definitions template struct is_referencable {static const bool value = true;};