Boost logo

Boost :

From: Dr. Franz Fehringer (fehrin_at_[hidden])
Date: 2004-05-27 09:06:19


> Joaquín Mª López Muñoz wrote:
.
.
.
> Good question. I should have explained of course.
> Well vacpp has only in some circurmstances a problem with the in class
> member initialization. For instance following does not work (confirmed
> by IBM):
>
> class A
> {
> public:
> static const int value = true ;
> } ;
>
> int main()
> {
> int v1 = A::value ; // does work
> bool v2 = A::value ; // does not work
> return 0 ;
> } ;

Hello,

I know i argue with eminent C++ specialists in this group, but i think the
code above is not correct.
To my best knowledge even with the inclass line
static const int value = true ;
you have to give a definition outside of the class:
int A::value;
Apart from that
return 0;
should be unnecessary and there is a spurious semicolon after the last brace;

Greetings

Franz


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