Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2003-01-26 12:50:51


On Sun, 26 Jan 2003 12:08:35 -0000, "John Maddock"
<jm_at_[hidden]> wrote:

>No go ahead, BTW other compilers (Borland and Sun off the top of my head),
>always make enum's int sized as well.

Ok. It's not clear to me if you prefer having no caveat at all, or
generalizing it a bit though.

I don't know about Sun, but Borland does support in-class
initialization, so BOOST_STATIC_CONSTANT uses that. If you explicitly
use an enum than it's not a problem of BOOST_STATIC_CONSTANT. In other
words, the intent is not to warn about enumerations in general, but to
warn the user that BOOST_STATIC_CONSTANT doesn't solve all the
problems and that he may have problems like this with some compilers:

    if (boost::integer_traits<unsigned int>::const_max < 0) {
        std::cout << "whoops\n";
    }

Who would expect this? Here you have two problems: in-class
initialization isn't supported *and* enums don't work correctly
either.

Genny.


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