23 #ifndef TCLAP_DEFER_DELETE_H 24 #define TCLAP_DEFER_DELETE_H 37 virtual ~DeletableBase() {}
41 class Deletable :
public DeletableBase {
43 Deletable(T *o) : _o(o) {}
44 virtual ~Deletable() {
delete _o; }
47 Deletable(
const Deletable<T> &) {}
48 Deletable<T> operator=(
const Deletable<T> &) {}
53 std::list<DeletableBase *> _toBeDeleted;
58 for (std::list<DeletableBase *>::iterator it = _toBeDeleted.begin();
59 it != _toBeDeleted.end(); ++it) {
66 _toBeDeleted.push_back(
new Deletable<T>(toDelete));
72 #endif // TCLAP_DEFER_DELETE_H
DeferDelete can be used by objects that need to allocate arbitrary other objects to live for the dura...
void operator()(T *toDelete)