Boost logo

Boost :

Subject: [boost] static in_class constants
From: Christian Henning (chhenning_at_[hidden])
Date: 2010-03-12 16:12:44

Hi there, I'm finishing up some linker problems I have with gcc. One
area of problems seems to be static in_class constants that I have
declared in my header file. MSVC doesn't have problem with it but gcc
is complaining. I'm wondering how other libs in boost are dealing with
these problems.

For instance in my new gil::io lib I define some tags in pnm_tags.hpp
as follows:

/// Defines type for image type property.
struct pnm_image_type : property_base< uint32_t >
    BOOST_STATIC_CONSTANT( type, _mono_asc = 1 ); // Monochrome ASCII encoding
    BOOST_STATIC_CONSTANT( type, _gray_asc = 2 ); // Gray level ASCII encoding
    BOOST_STATIC_CONSTANT( type, _color_asc = 3 ); // sRGB color ASCII encoding
    BOOST_STATIC_CONSTANT( type, _mono_bin = 4 ); // Monochrome binary encoding
    BOOST_STATIC_CONSTANT( type, _gray_bin = 5 ); // Gray level binary encoding
    BOOST_STATIC_CONSTANT( type, _color_bin = 6 ); // sRGB color binary encoding


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