Smart pointers should be fine to use (it was mostly implemented in TR1 anyway). Basically, you just replace:
Thing* my_thing = new Thing(); // do stuff delete my_thing;
with:
unique_ptr<Thing> my_thing(new Thing());
You can also get rid of the "delete" command, as the Thing will automatically be deleted when it goes out of scope.
If the pointer will be shared by multiple containers, you need to use shared_ptr instead of unique_ptr.
Smart pointers should be fine to use (it was mostly implemented in TR1 anyway). Basically, you just replace:
Thing* my_thing = new Thing();
// do stuff
delete my_thing;
with:
unique_ptr<Thing> my_thing(new Thing());
You can also get rid of the "delete" command, as the Thing will automatically be deleted when it goes out of scope.
If the pointer will be shared by multiple containers, you need to use shared_ptr instead of unique_ptr.