From: "Fernando Cacciola" <[EMAIL PROTECTED]>
> > I don't think that optional<bool> is an important use case (outside of
> > generic contexts) since optional<bool> is simply a tri-state type with
an
> > inconvenient interface.
> >
> Good point. I've been using optional<bool> long before tribool existed.
> Now I might replace optional<bool> with tribool;  but, a user still
> can have optional<bool>.

But what is gained by using optional<bool> instead of

enum optional_bool { uninitialized, true_, false_ };

?

Especially if you take into account that with the enum you can use
descriptive identifiers. It's a good idea to use enums in interfaces even
for non-optional bools when the meaning of 'true' isn't immediately
apparent.

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to