Is it possible to overload delete operator to set the pointer to null?

前端 未结 0 922
温柔的废话
温柔的废话 2021-01-22 07:44

What I want to do is overload the delete operator for my class to automatically set the pointer to null after deleting it so I can safe delete it inside a member function, like

相关标签:
回答
  • 消灭零回复
提交回复
热议问题