Boost logo

Boost :

Subject: Re: [boost] std::map::find() wrapper
From: Marsh Ray (marsh_at_[hidden])
Date: 2011-05-05 11:52:07


On 05/05/2011 09:34 AM, Thorsten Ottosen wrote:
>
> Maybe we need a specialization boost::optional<T*>
> that does not store a boolean flag (and otherwise behave like optional<T&>?

That would change the semantics of the existing type.

> Or a new dummy smart pointer to signify that the held ptr object is
> owned by another object. E.g. boost::ptr<T> ?

I like it!

boost::dumb_and_weak_pointer<T> ?

You could do it today with shared_ptr and a custom no-op deleter, or
more efficiently with intrusive_ptr and no-op implementations of
intrusive_ptr_(add_ref|release).

- Marsh


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