VC7 and const class members

Started by
3 comments, last by billybob 21 years, 1 month ago
does VC7 handle const class members correctly? VC6 doesn''t, i''m pretty sure you are supposed to be able to do something like this:

class MyClass
{
   const int SomeConst = 5; // doesn''t work in vc6, but i''m almost positive you are supposed to be able to
};
 
if you are supposed to be able to, does VC7 do it right?
Advertisement
Sure does.

Edit: But only when they are static const

If I had my way, I'd have all of you shot!

codeka.com - Just click it.

[edited by - Dean Harding on March 6, 2003 5:56:33 AM]
even better, thanks
Considering const members are instance-specific, they need to be initialized in the constructor.
daerid@gmail.com
quote:Original post by daerid
Considering const members are instance-specific, they need to be initialized in the constructor.

Except, as has been said, when they are static

pan narrans | My Website | Study + Hard Work + Loud Profanity = Good Code
Minister of Propaganda : leighstringer.com : Nobody likes the man who brings bad news - Sophocles (496 BC - 406 BC), Antigone

This topic is closed to new replies.

Advertisement