[LC++]static const char*

Vincent Penquerc'h Vincent.Penquerch at artworks.co.uk
Fri Dec 14 05:17:03 UTC 2001


> That's strange, AFAIK it should complain in the same manner in both
> cases. This is Java-like syntax, C++ doesn't work this way.

It's valid, but rather new. It's there to avoid people defining
anonymous enums, and is quite useful for things like:

template<typename type> class Vector8 {
public:
  static const int size=8;
  type data[size];
};

which would not be possible with the usual static member
way, since the value of size would not be known at the time
of compiling the class definition.

-- 
Vincent Penquerc'h 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linux.org.au/pipermail/tuxcpprogramming/attachments/20011214/9b6f5e83/attachment.htm 


More information about the tuxCPProgramming mailing list