Boost logo

Boost :

From: Daniel Frey (daniel.frey_at_[hidden])
Date: 2003-05-16 03:29:14

Baptiste Lepilleur wrote:
> Sun CC 5.3 as a problem with the safe bool idiom, which result in a
> compiler internal error when bool conversion is used.
> The attached patch (based on boost 1.30) implements the work-around used
> by Boost.Function library for Sun CC 5.3 (implement a simple bool conversion
> operator).
> There is probably other libraries in boost that could use that
> work-around.

Maybe you want to add a private declaration for an operator int() with
no definition in the work-around. I don't know if the SunCC accepts
this, but I guess it should not stress the compiler too much. This will
give you the same level of safety like the safe-bool-idiom, thus
creating a really compatible work-around at the cost of some ugly error
messages in case the users tries to convert to int, double or something.
See also the bool_testable-implementation in the operators library and
the according discussion in the list's archive.

Regards, Daniel

Daniel Frey
aixigo AG - financial training, research and technology
Schloß-Rahe-Straße 15, 52072 Aachen, Germany
fon: +49 (0)241 936737-42, fax: +49 (0)241 936737-99
eMail: daniel.frey_at_[hidden], web:

Boost list run by bdawes at, gregod at, cpdaniel at, john at