On Feb 27, 2013 1:33 AM, "John Maddock" <boost.regex@virgin.net> wrote:
>>>
>>> At least one other compiler does in fact require the bare definition to
>>> link properly, and doesn't generate it automatically as an enhancement.
>>> So I need to make these definitions conditional based on the platform
>>> (and perhaps the exact compiler version? That's why I like to use the
>>> existing config knowledge base!)
>>>
>>> I see that Boost has BOOST_STATIC_CONSTANT but that is for compilers
>>> that don't have the in-class initialization at all.
>>>
>>> So if Boost is using such constructs, how does it deal with the linker
>>> idiosyncrasy?
>>
>>
>> You could always not initialize inline and therefore always supply a separate definition.
>
>
> Which would prevent them being used as constant-expressions?
>
When we care about these being used as constant expressions, we declare and initialize inline, and then we use preprocessor checks to decide whether or not to provide definitions in a cop file. It is best to provide them for gcc, but not for msvc 2010 for example.
Brian