[C++-sig] object().attr_allow_null()

David Abrahams david.abrahams at rcn.com
Mon Jul 22 20:35:04 CEST 2002


From: "Ralf W. Grosse-Kunstleve" <rwgk at yahoo.com>


> --- David Abrahams <david.abrahams at rcn.com> wrote:
> > From: "Ralf W. Grosse-Kunstleve" <rwgk at yahoo.com>
> >
> > > I very much like this idea. But let me ask anyway:
> > > If is() were a free function, what signature(s) would it have?
> > > Just one overload: is(object a0, object a1)?
> >
> >     is(object const&, object const&); // for efficiency
> >
> > No point in checking the object identity of non-objects ;-)
> > Hmmn, I take it back; you ought to be able to pass, e.g. NumPyArray*
here.
> > Anyway, the single signature above will do for the time being.
>
> Hm. Don't you want is() to be symmetric?
>
> is(a,b)
> is(b,a)
>
> Now, if is() is a member function of object, but b may not be of type
object,
> you break the symmetry.

I don't really care all that  much, but:

    object(x).is(y) looks OK to me.

> Then is(getinitargs, None) would seem to be the better solution.
>
> BTW: how could it be None (upper case) in a boost library? Isn't that
bending
> the (your!?) rules?

Yep. Ain't life grand?

-Dave






More information about the Cplusplus-sig mailing list