Mike Hewson wrote:
Anyway I think only integrals are allowed for 'static const'.
Yes you are right. Here is also what VC++ 2003 and 2005 Beta say about it:
C:\c>cl /clr temp.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 13.10.3077 for .NET
Framework
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
temp.cpp
temp.cpp(4) : error C2864: 'x' : only const static integral data members
can be
initialized inside a class or struct
C:\c>
C:\c>cl /clr temp.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 14.00.40904
for Microsoft (R) .NET Framework version 2.00.40607.16
Copyright (C) Microsoft Corporation. All rights reserved.
temp.cpp
temp.cpp(4) : error C2864: 'ABC::x' : only static const integral data
members ca
n be initialized within a class
C:\c>
--
Ioannis Vranos
http://www23.brinkster.com/noicys