
9 Feb
2012
9 Feb
'12
9:24 a.m.
Den 09-02-2012 09:59, Nevin Liber skrev:
On 8 February 2012 17:18, Andrey Semashev<andrey.semashev@gmail.com> wrote:
optional< T& > is a useful thing when you want to apply operators (such as relation operators or streaming) to the referred value. In generic code you don't have to specialize for pointers to do the right thing.
+1 here. Please keep the interfaces the same, unless you have a *very* compelling reason not to.
+1. optional<T*> cannot optimize the bool away, because it can be null. So optional<T&> is both more efficeint and more handy. -Thorsten