双重释放 问答列表

C++中“delete this”和“this->~Obj”之间的区别

作者:ln vv 提问时间:2/13/2023

当我编写演示字符串类时,在复制分配函数中,我尝试在复制之前通过“delete this”清除自身。但它失败了。 Str &operator=(const Str &s) { if (this !...


共1条 当前第1页