シングルトンクラスの実装で代入演算子を民営化する必要性を誰かが正当化できますか?
Singleton& operator=(Singleton const&);プライベートにすることでどのような問題が解決しますか?
class Singleton {
public:
static Singleton& Instance() {
static Singleton theSingleton;
return theSingleton;
}
private:
Singleton(); // ctor hidden
Singleton(Singleton const&); // copy ctor hidden
Singleton& operator=(Singleton const&); // assign op. hidden
~Singleton(); // dtor hidden
};