From: "Fernando Cacciola" <[EMAIL PROTECTED]> [...] > Conclusion: I will adopt William's reset, leaving operator*() return > a reference to the optional value *only* if it is initialized > (independently of whether opt is const or not). > > Therefore, the proxy is not needed. And so value() isn't needed either. > > (B) > Since most reviewers wanted it, I will add a safe_bool idiom, which will > allow > conditional expressions like: > > if ( opt ) > if ( opt == 0 ) > if ( opt != 0 )
Can you please update the documentation to reflect the changes? I want to vote on the revised version. ;-) > However, I'm still unconvinced that uninitialized optionals should compare > false, > and even though, you can always compare optional values (via operator*), so > I see no benefit in defining relational operators directly (thus these > operators > will be poisoned) I think that the proposed comparisons make a lot of sense. You should consider providing operator<<(std::ostream&, optional), too. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost