Boost logo

Boost :

From: Darin Adler (darin_at_[hidden])
Date: 2002-05-01 17:57:53


On Wednesday, May 1, 2002, at 02:24 PM, Bryan Leppard wrote:

> Has there been any discussion on making smart pointers behave like dumb pointers with respect to const correctness?

The boost smart pointers already behave like dumb pointers with respect to const (and volatile) correctness. But note the syntax -- it sometimes confuses people:

The object pointed to is "const":

     T const * -> shared_ptr<T const>

or if you prefer:

     const T * -> shared_ptr<const T>

The pointer is "const":

     T * const -> const shared_ptr<T>

Both the object and the pointer are "const":

     T const * const -> const shared_ptr<T const>

Hope that helps.

     -- Darin


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