Hi,
If we assume someone wants a global + unique object, why isn't a namespace always the preferred approach in C++, over implementing a singleton class?
But why not have non-member functions that share static data, declared in an unnamed namespace? And why isn't this generally suggested as a better alternative to writing a singleton class in C++?
Please help.
Thanks!
I didn't find the right solution from the Internet.
References:https://www.gamedev.net/forums/topic/692835-what-cant-a-namespace-do-that-a-singleton-does/
Google Product Launch