Given the following : #include <iostream> using namespace std; class A { public: void func() {delete this;}
In this answer, Ryan directly calls the virtual destructor. I\'ve tested the code in VS2010, and it correctly calls all destructors (tested with logging statements). Is it actually valid to do so? Wha
What开发者_如何学运维 actually happen when I execute this code? class MyClass { MyClass() { //do something
Is it good practice for an object in Objective-C to commit suicide? That is, for an object to declare [self dealloc] where -dealloc permits an orderly wind down as usual? What are the principal risks?
Is it allowed to delete this; if the delete-statement is the last statement that will be executed on that instance of the class? Of course I\'m sure that the object represented by the this-pointer is
Is it possible to create a 开发者_运维知识库PHP file that runs once with no errors and deletes itself?<?php unlink(__FILE__); ?>
I was just reading this article and wanted SO folks advice: Q: Should delete this; be call开发者_如何学JAVAed from within a member method?Normally this is a bad idea, but it\'s occasionally useful.
I\'m writing a state manager for a game. I\'ve got most of the logic down for how I want to do this. I want states, which will be classes, to be handled in a stack in the StateManager class. Each stat