
5 May
2011
5 May
'11
2:34 p.m.
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