разрешено ли это удалить это; , если удаление удаления является последним оператором, который будет выполнен в этом случае класса? Конечно, я уверен, что объект, представленный This < /code>-точкой, является новым < /code> ly-create.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 of this "SomeModule" object:
delete this;
}
< /code>
Можно это сделать? < /p>
Подробнее здесь: https://stackoverflow.com/questions/315 ... lowed-in-c