Let say we need to have just one instance of some class in our project. There are couple ways of doing it.
I want to compare. Please can you review my understanding.
You could also use the Borg pattern, which is a little more complicated in C++ unless you have access to a shared pointer class. The idea is that any number of Borg classes can be instantiated, but their state is shared across all instances.