"Rozental, Gennadiy" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > Maybe it's a minor point, but I think the !! is really > > ugly. Have you > > > considered the safe_bool idiom that's used in some other Boost > > > libraries? (smart_ptr to name one.) > > > > > Yes, I did. > > safe_bool (among other alternatives) was rejected because of > > the following > > (this specific point is explained in detail on the documentation) > > > > void foo() > > { > > optional<bool> opt = get_some(); > > bool is_it = opt; > > } > > Did you consider to provide bool specialization that does not have safe_bool > convertion and allowing it for all other types? > Yes, I did it too. The problem is that in this case, optional<T!=bool> and optional<bool> would have different semantics; subtly different actually, which is worst. I much prefer a consistent semantic.
-- Fernando Cacciola _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost