Page 1 of 1

Question regarding singletons

Posted: Wed Jan 28, 2009 12:38 pm
by Ginto8
I was wondering, if you had a singleton that was really the main control center for a program, and you really only had to call start(), which would take care of all the stuff that has to be done, could you do something like this, presuming that Main::get_instance()'s return type was Main*?

Code: Select all

Main::get_instance()->start()

Re: Question regarding singletons

Posted: Wed Jan 28, 2009 2:09 pm
by MarauderIIC
Yes. Although we use references, so we occasionally do something like Main::getInstance().start(); usually if we don't need to reference it more than once (like a debug call or a call to the text engine or something)