可能重复:
Is it OK to use "delete this" to delete the current object?
Should objects delete themselves in C++?有用的成员函数 '删除'
我只是碰到this问题一提出programmers.stackexchange,看到的问题关于做一个delete this;
里面的成员函数。
从我所了解的情况来看,这通常是一个禁忌,然而在某些情况下这可能会有用。什么时候这样做会有用,以及没有这样做的技术原因是什么?
另请参阅http://stackoverflow.com/q/1866193/57428和http://stackoverflow.com/q/1866461/57428 – sharptooth 2010-12-15 12:11:01