Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-11-25 10:51:50


Joel de Guzman wrote:
>
> IIUC, what you mean is that we do not have to review something like
> that. Ok, but it would still be good to have a single implementation.
> Spirit uses:
>
> struct safe_bool_impl
> {
> int* dummy;
> };
>
> typedef int* safe_bool_impl::*safe_bool;
>
> inline safe_bool
> make_safe_bool(bool cond)
> {
> return cond ? &safe_bool_impl::dummy : 0;
> }
>
> and it is used all throughout.

Then you should call it unsafe_bool since having a conversion to it permits
comparisons between unrelated types.


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