[C++-sig] intrusive pointer comparison in python

Gross, Ashley agross at irobot.com
Sat Oct 7 19:49:26 CEST 2006


I think I've got something worked out, thanks for all your help :)

Ashley

> -----Original Message-----
> From: c++-sig-bounces at python.org [mailto:c++-sig-bounces at python.org]
On
> Behalf Of David Abrahams
> Sent: Saturday, October 07, 2006 8:48 AM
> To: c++-sig at python.org
> Subject: Re: [C++-sig] intrusive pointer comparison in python
> 
> Alex Mohr <amohr at pixar.com> writes:
> 
> >>> class_<foo,fooHandle>("foo")
> >>>      .def("__eq__", are_ptrs_equal<fooHandle>);
> >>
> >> isn't this the same as
> >>
> >>   class_<foo,fooHandle>("foo")
> >>         .def(self == self)
> >>         ;
> >> ?
> >
> > Unless I'm mistaken, no I don't think so.  I think that 'self ==
self'
> > will generate an overload expecting 'foo' arguments, and will
compare
> > the 'foo' objects directly, rather than comparing 'fooHandle's.
Ashley
> > said that 'foo' is not comparable.
> >
> > Let me know if I'm misreading operators.hpp though.
> 
> You're not.  Thanks for pointing out what I should have seen.
> 
> --
> Dave Abrahams
> Boost Consulting
> www.boost-consulting.com
> 
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig



More information about the Cplusplus-sig mailing list