Archived

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

logout

stl map initializing

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
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