タグ付けされた質問 「self-destruction」

10
これは削除できますか?
delete this;delete-statementがクラスのそのインスタンスで実行される最後のステートメントである場合、許可されますか?もちろん、this-pointerで表されるオブジェクトは、newly-created だと確信しています。 私はこのようなことを考えています: void SomeModule::doStuff() { // in the controller, "this" object of SomeModule is the "current module" // now, if I want to switch over to a new Module, eg: controller->setWorkingModule(new OtherModule()); // since the new "OtherModule" object will take the lead, // I want to get rid …
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.