Boost logo

Boost :

Subject: Re: [boost] [Review] Type Traits Introspection library by Edward Diener starts tomorrow Friday 1
From: John Maddock (boost.regex_at_[hidden])
Date: 2011-07-02 04:44:05

>> I mean things like
>> struct A
>> {
>> static const int value = 42;
>> };
> That works correctly in the library for gcc and VC++. Evidently the code
> that tests, which uses an expression of &A::value, is accepted by those
> compilers. Is it illegal to take the address of a static const data member
> in C++ ?

No, but you *may* need an out-of-line definition for the member "value" if
the compiler considers the address to be "used": my guess is you're only
using it within the context of another metafunction, so probably this should
be OK.... probably ;)

HTH, John.

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