On Mon, May 29, 2006 at 07:13:16PM +1000, Alexander Luddy wrote:
> I recently upgraded from 1.24 to 220.127.116.11 and have encountered a problem
> in regards to object::operator= .
> I have code similar to the code shown below:
> luabind::object result(luabind::from_stack(LuaTools::luaState(), -1));
> float foo = 5;
> result = foo;
> Previously this code compiled fine however I now get a compile error
> suggesting that the following object operator mentioned in the
> template<class T>
> object& operator=(T const&);
> is not being found.
> Here is the error:
> error C2679: binary '=' : no operator found which takes a right-hand
> operand of type 'float' (or there is no acceptable conversion)
> Looking at the object declaration in the luabind code it looks as if
> operator= is no longer declared for object in version 18.104.22.168 like it
> was in version 1.24.
> Have I missed something?
That operator was lost in the rewrite of object. We should probably put it
back. Right now you can use a slightly more cumbersome syntax where you
construct an object from your float.
result = object(LuaTools::luaState(), foo);
> Is there something special I need to do to get the above code to work?
I will apply the lua 5.1 patches and add this operator back and check it in
to the cvs.