overloading operator delete, or how to kill a cat?

前端 未结 5 821
时光说笑
时光说笑 2021-01-19 15:15

I am experimenting with overloading operator delete, so that I can return a plain pointer to those who don\'t wish to work with smart pointers, and yet be able to control wh

5条回答
  •  自闭症患者
    2021-01-19 15:42

    Once the destructor for an object has been called, anything you do with the object is undefined. What you are trying to do is not possible.

提交回复
热议问题