Boost logo

Boost :

From: Andrew D Jewell (ajewell_at_[hidden])
Date: 2000-03-13 09:53:15


> deep_opaque_ptr // also known as CopyPtr
> deep_ptr
> shared_opaque_ptr
> shared_ptr // same as current
> scoped_opaque_ptr
> scoped_ptr // same as current

If I may be so bold, I would like to suggest adding "Qualified" bit,
and doubling the number of types. By "Qualified", I mean passing
through the constness, such that a "const shared_ptr" dereferences to
a pointer to a const object. I have found my own hastily-assembled
const_scoped_ptr to be quite helpful. In fact, I have yet to find a
need (in my own code) for the non-qualified version.

       T * operator -> () throw() { return p; }
const T * operator -> () const throw() { return p; }

While I'm on my soap box, I would like to strongly agree with the
LACK of "array" options like shared_array. The same effect can be
much more clearly and safely achieved with shared_ptr< vector<> > or
some such.

so I would see the list as

deep_ptr
deep_opaque_ptr
deep_qualified_ptr
deep_opaque_qualified_ptr
shared_ptr
shared_opaque_ptr
shared_qualified_ptr
shared_opaque_qualified_ptr
scoped_ptr
scoped_opaque_ptr
scoped_qualified_ptr
scoped_opaque_qualified_ptr

Andy Jewell


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk