Boost logo

Boost :

From: Fernando Cacciola (fernando_cacciola_at_[hidden])
Date: 2002-12-10 16:28:23


----- Original Message -----
From: "Peter Dimov" <pdimov_at_[hidden]>
To: "Boost mailing list" <boost_at_[hidden]>
Sent: Tuesday, December 10, 2002 4:26 PM
Subject: Re: [boost] Formal review: Optional library

> From: "Fernando Cacciola" <fernando_cacciola_at_[hidden]>
> > I understand your reasoning, but what do you suggest?
>
> I suggest that we need not give much weight to optional<bool> when
designing
> optional<T>'s interface.

I see.
>
> > Leaving optional<bool> inherently unsafe?
>
> Unsafe? The conversion from optional<bool> to bool might be confusing, but
> it's not inherently unsafe.
>
I don't know.
Isn't it unsafe the fact that you can mistakenly forget to write '*' and get
the initialized state instead of the value? (now you get a compiler error)

I don't know.
I'd like to see others opinions.

Should optional<> have safe_bool which would allow possibly unintended
conversions from optional<bool> to bool?
Will it be enough to put appropriate warnings and recommendations on the
documentation?

Fernando Cacciola


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk