July 01, 2005
Unsmart Pointers, Part I
Listing 2
void SomeFunction(undeletable_ptr<SomeObject>);
void CodeSnippet() {
SomeObject* p = new SomeObject();
try {
SomeFunction(p);
}
catch(...) { }
delete p; // now known to be valid
}
|
|
||||||||||||||||||||||||||||
|
|
|
|