Re: luabind: problem retrieving values from table indexed by non-built-in classes

qwer 1304 <[email protected]> Wed, 25 Apr 2012 18:52:56 +0300
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
I tried overloading the == operator like this:
struct test_param
{
    int obj;
    bool operator==(test_param const& rhs) const
    {
        return obj == rhs.obj;
    }
};and
module(L)
    [
        class_<test_param>("test_param")
            .def_readwrite("obj", &test_param::obj)
            .def(const_self == const_self)
    ];
It didn't change anything.
As for using a local object for a key: first, it's a valid test, which still shouldn't failsecond, I moved it out from the stack to heap, but it didn't change the result.
The weird thing is that the data is there in the table and can be retrieved using iterate().
David
> From: [email protected]
> Date: Wed, 25 Apr 2012 16:32:28 +0100
> To: [email protected]
> Subject: Re: [luabind] luabind: problem retrieving values from table indexed by non-built-in classes
> 
> 2012/4/25 qwer 1304 <[email protected]>:
> > Ryan Pavlik says that his version passes now all tests.
> >
> > In any case, IMHO it's important to figure out why such a simple test as I
> > put in my original message fails.
> > I.e., I'd expect a true application to be able to enter a value into a table
> > for a given key in an object and to be able to retrieve it.
> >
> > As the test case shows - it cannot.
> >
> > Thx,
> > David
> >
> >> Date: Wed, 25 Apr 2012 16:49:45 +0200
> >> From: [email protected]
> >> To: [email protected]
> >> Subject: Re: [luabind] luabind: problem retrieving values from table
> >> indexed by non-built-in classes
> >
> >>
> >> The object identity test failing is a known issue as far as I know,
> >> the commit message from when it was added states so.
> >>
> >>
> >> ------------------------------------------------------------------------------
> >> Live Security Virtual Conference
> >> Exclusive live event will cover all the ways today's security and
> >> threat landscape has changed and how IT managers can respond. Discussions
> >> will include endpoint security, mobile security and the latest in malware
> >> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> >> _______________________________________________
> >> luabind-user mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/luabind-user
> >
> > ------------------------------------------------------------------------------
> > Live Security Virtual Conference
> > Exclusive live event will cover all the ways today's security and
> > threat landscape has changed and how IT managers can respond. Discussions
> > will include endpoint security, mobile security and the latest in malware
> > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> > _______________________________________________
> > luabind-user mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/luabind-user
> >
> 
> Personally I would take a wild stab in the dark and say your object
> does not have a comparison operator and what does it mean to put a
> stack object in a container?
> 
> Liam
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> luabind-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/luabind-user

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

_______________________________________________
luabind-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/luabind-user