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

前端 未结 6 524
甜味超标
甜味超标 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:31

    you shouldn't try to copy it. But having said that.... you can memcpy it. Only reason you'd do that is that you know what your doing, you know the consequences, etc etc. Its generally stepping out of the bounds of whats generally acceptable. But you might want to do something a bit ninja.

提交回复
热议问题