Boost logo

Boost :

Subject: Re: [boost] std::map::find() wrapper
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2011-05-05 10:34:35


Den 05-05-2011 15:49, Sebastian Redl skrev:
> On 05.05.2011 15:25, Thorsten Ottosen wrote:
>>
>> Well, how does the library user knows that an optional<T&> does not
>> own the stored reference?
> C++ references are *never* owning. Have never been, except in really
> outlandish designs.
>

Maybe we need a specialization boost::optional<T*>
that does not store a boolean flag (and otherwise behave like optional<T&>?

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

-Thorsten


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