Kiekos
Member
|
RE: GUI Singleton
So what's the risk of not making them private?
|
|
02-01-2014 08:42 PM |
|
Rubeus
Member
|
RE: GUI Singleton
(02-01-2014 08:42 PM)Kiekos Wrote: So what's the risk of not making them private?
Multiple instances. But the static instance would always remain the same, making the second instance different aside from the static member. Basically, a mess.
|
|
02-01-2014 09:07 PM |
|
Kiekos
Member
|
RE: GUI Singleton
So, having the class declared like this:
Code:
class Debugger
{
public:
static Debugger& Instance();
void myFunction();
private:
Debugger();
Debugger( Debugger& );
void operator=(const Debugger&);
};
I can rest assured there's always gonna be only one instance? (from what I've understood)
|
|
02-01-2014 11:10 PM |
|
rstralberg
Member
|
|
02-01-2014 11:16 PM |
|