C++ (Qt)class Example{ public: static Example *instance(); private: Example(){}}; //... Example * Example::instance(){ static Example *inst = new Example; return inst;}
C++ (Qt)class CharacterInfo{public: static CharacterInfo &instance() { static CharacterInfo obj; return obj; } private: CharacterInfo() {}};