Jump to content
  • Advertisement

Archived

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

logout

stl map initializing

This topic is 5532 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

in my singelton ( CKeeper ) i have a map: static map m_Storage; i initialize my local copy of CKeeper like this: CKeeper* CKeeper::m_inst = NULL; and what sould i initialize my map to ? currently it is looking like this: map CKeeper::m_Storage; is this correct ?

Share this post


Link to post
Share on other sites
Advertisement
You shouldn''t initialize it to anything; it will run the default constructor.

However, this is most likely a bad design. A singleton does not need any static members, except for the instance.

Share this post


Link to post
Share on other sites
if it is a static, he needs to do what he did, which is correct (we know html killed the templates), but yeah, if its a singleton, its pointless to have it static.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!