Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

billybob

VC7 and const class members

This topic is 5610 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
Advertisement
Considering const members are instance-specific, they need to be initialized in the constructor.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!