[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: getting address of userdata
- From: "Matthew Armstrong" <turkeypotpie@...>
- Date: Mon, 21 May 2007 19:04:04 -0700
That's essentially what I did with __tostring, but I had to restore it back to its old value later. Kinda hackish, but I guess it works.
Peter Odding <email@example.com> wrote:
Matthew Armstrong wrote:
> I'm pretty sure the 'No such operator defined' error is coming from
> as the userdata I'm running this on comes from a luabind created object.
> If I temporarily remove the __tostring metamethod, the error goes away, so
> that solves my problem.
> Another thing luabind does is override the __eq metamethod, to what it
> thinks == should be, which is a somewhat complicated definition. What if I
> want to compare two userdata objects solely based on whether the references
> are equal?
Not sure whom you are asking, so just in case: I have no idea. Until 5 minutes
ago I didn't know about luabind ;) (and I wouldn't touch C++ with a ten-foot
pole). Good luck though.
- Peter Odding
PS. As a quick hack you could consider debug.getmetatable(foo).__eq = nil, which
should get you back to the default behavior.