Lua_icxx  1.02 (Aug 2011)
NotAllowedAsFunctionArgument< TT > Struct Template Reference

Prevent function calls that use LuaTempResult as one of the parameters. More...

#include <LuaFuncRef.h>

List of all members.

Static Public Member Functions

static const TT & ref (const TT &obj)
 used only internally

Detailed Description

template<typename TT>
struct NotAllowedAsFunctionArgument< TT >

Prevent function calls that use LuaTempResult as one of the parameters.

Function calls return a LuaTempResult, so using it as a parameter will lead to wrong results due to stack manipulation conflicts. Use LuaExpr instead (of a call to LuaInterpreter::eval or to whatever Lua_icxx function/method returning a LuaTempResult).

Class template specializations are declared for classes that must not be used as function calls parameters (such as LuaTempResult, and its Item inner class), but they are left undefined; this leads to a compilation error when attempt is made to pass such object to function call.

For instance, in MS VC++ 2005, the error is C2027: use of undefined type 'NotAllowedAsFunctionArgument<LuaTempResult>', in file LuaFuncRef.h. To find source code that uses the forbidden LuaTempResult, look in the Output window at the bottom of the error message.

Definition at line 163 of file LuaFuncRef.h.