[C++-sig] Retiring "ref", etc.

David Abrahams david.abrahams at rcn.com
Tue Jun 11 00:30:38 CEST 2002


----- Original Message -----
From: "joel de guzman" <djowel at gmx.co.uk>
To: <c++-sig at python.org>
Sent: Monday, June 10, 2002 4:04 PM
Subject: Re: [C++-sig] Retiring "ref", etc.


>
> ----- Original Message -----
> From: "David Abrahams"
>
> > >     object: cannot be null [high level interface]
> > >     object_ptr: can be null [low level interface]
> >
> > The problem is that object_ptr needs to be parametrized on the type
it's
> > pointing at (e.g. PyObject, PyTypeObject...). object_ptr<PyObject> is
> > redundant and object_ptr<PyTypeObject> is sort-of inaccurate.
> >
> > So my latest thought is that the smart pointer class is spelled
"handle",
> > and the one currently spelled "ref" is spelt "handle<>". I could supply
> >
> >     typedef handle<> obj_ptr;
> >
> > or
> >
> >     typedef handle<> hdl;
> >
> > or
> >
> >     typedef handle<> objptr;
> >
> > but I'm resisting: I hate unpronounceable names.
>
> Yes. You wrote the naming guidelines ;-)
>
> "handle" is nice! How about:
>
>     typedef handle<PyObject> object_ptr;

For people who prefer underscores to angle brackets? ;-)

object_ptr
handle<>

Which one is easier?

>     typedef handle<PyTypeObject> type_ptr;

I like that one. I'd be willing to supply object_ptr just for consistency.

-Dave







More information about the Cplusplus-sig mailing list