How to use a object whose copy constructor and copy assignment is private?

前端 未结 6 580
甜味超标
甜味超标 2021-01-14 07:43

In reading TCPL, I got a problem, as the title refered, and then \'private\' class is:

class Unique_handle {
private:
    Unique_handle& operato         


        
6条回答
  •  清歌不尽
    2021-01-14 08:35

    Usually, the idiom of making your copy constructor and assignment operator private (and unimplemented) implies that the original author of the class specifically did not want this object to be copyable.

提交回复
热议问题