RE: [Dev-C++] static vector initialization
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <no...@ho...> - 2002-10-16 16:33:55
|
> -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of Daniel Glenfield > Sent: Wednesday, October 16, 2002 2:06 PM > To: ai...@if...; dev...@li... > Subject: Re: [Dev-C++] static vector initialization >=20 >=20 > I am sure that the only way to initialise static members si=20 > with a static=20 > member function, but I don't know about vectors. >=20 > Is static const int size =3D 10; actually allowed? A static member is a regular global namespace entity (object or function) which for notational purposes is defined inside the class definition (and the function as a member function style while it is not). For static integral members the initialization can be done inside the class declaration without needing an external definition as with other types. This is only supported by recent compiler releases (compiler vendors had more important ANSI C++ things to implement than that in the past). Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL: http://run.to/noicys |