Boost logo

Boost :

From: scleary_at_[hidden]
Date: 2002-07-17 07:48:52


> From: Philippe A. Bouchard [mailto:philippeb_at_[hidden]]
>
> > This usage of 'mutable' was rejected because it has the side effect that
two
> > copies of an object are not equivalent. This, in turn, can cause nasty
> > side-effects if you use mutable_ptr with Standard containers and
algorithms.
>
> Yeah I know, this is why 'mutable' was in the class name; to warn
developer
> from its side effects.
>
> > While you can usually get away with using it in containers (although
it's
> > not technically portable), the real problem comes in using it with
> > algorithms:
>
> mutable_ptr<> should have restricted usages for primitive operations like
> container copyings and destructions.

OK, as long as the docs clearly state that 'mutable_ptr' is not guaranteed
to work with any Standard (or other generic) algorithm or container. A "use
at your own risk" clause...

        -Steve


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