Daniel Frey wrote: > Fernando Cacciola wrote: >> My main argument is that if those were allowed, you could write: >> >> optional<int> opt ; >> opt = 1 ; >> int i = *opt ; >> >> and the assymetry didn't look right to me. > > I agree that this looks wrong. What about this syntax: > > optional<int> opt; > *opt = 3; > int i = *opt; > opt->foo(); > This was exactly the way the originally submmited optional<> worked. I dropped it becasue reviweres thought that (*opt)=3 would lead to undefined behaviour just as if *opt were an rvalue. I realized that with true pointers, for instance, (*opt)=3 is in fact undefined behaviour, so I replace it with .reset()
Fernando Cacciola _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
