
13 Feb
2007
13 Feb
'07
1:02 a.m.
On 2/9/07, Felipe Magno de Almeida <felipe.m.almeida@gmail.com> wrote:
On 2/9/07, Mathias Gaunard <mathias.gaunard@etu.u-bordeaux1.fr> wrote:
Felipe Magno de Almeida wrote:
Why would it? T* and T& have very different semantics.
An optional T& has closer semantics to T* than a non-optional one.
Didn't understand what you mean. Could you rephrase?
An optional<T&> has nearly the same semantics as a T*. I think the only thing it's missing is pointer arithmetic, and it may be a little more clear that optional<T&> is non-owning (though less clear that it's Assignable). So I'm not sure either why anyone should use optional<T&> instead of T*. -- Namasté, Jeffrey Yasskin