Need of privatizing assignment operator in a Singleton class

前端 未结 7 1037
一生所求
一生所求 2021-01-18 04:01

Can someone justify the need of privatizing the assignment operator in a Singleton class implementation?

What problem does it solve by making Singleton& o

7条回答
  •  萌比男神i
    2021-01-18 04:37

    Inherit boost::noncopyable (privately) in singleton class pattern than to define private copy construction and assignment operator.

提交回复
热议问题