Can someone justify the need of privatizing the assignment operator in a Singleton class implementation?
What problem does it solve by making Singleton& o
Assignment on a singleton is simply a nonsense operation since only one object of it should ever exist.
Making the assignment operator private helps diagnose nonsense code such as the following:
Singleton& a = Singleton::Instance();
Singleton& b = Singleton::Instance();
a = b; // Oops, accidental assignment.