Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2005-01-13 12:26:48


"Jody Hagins" <jody-boost-011304_at_[hidden]> wrote in message
news:20050113121604.1f0f6ed0.jody-boost-011304_at_atdesk.com...
>
> Consider this simple example...
>
>
> #include <boost/test/test_tools.hpp>
>
> struct Foo
> {
> static unsigned int const x = 10;
> };
>
> int test_main( int, char* [] ) // note the name!
> {
> BOOST_CHECK_EQUAL(10U, Foo::x);
> return 0;
> }
>
>
>
> At least under gcc, I get a linker error, unable to find Foo::x, while
> the following code works fine...
>
>
> int test_main( int, char* [] ) // note the name!
> {
> BOOST_CHECK(10U == Foo::x);
> return 0;
> }

I remember very similar issue with MPL constants. I consider this a compiler
bug and it could (and should) be workaround on struct Foo implementation
level (did you try to use enum?)

Gennadiy


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