- /** Adds a postprocessor to the sequence, transferring ownership. The
- postprocessor will be deleted together with with sequence. It is also
- deleted if this call throws an exception. */
- void add_postprocessor_owned(PostProcessor *);
-
-private:
- void add_postprocessor(PostProcessor *, bool);
+ /** Adds an owned object, which will be deleted together with the sequence. */
+ template<typename T>
+ void add_owned(T *p)
+ { owned_data.push_back({ p, [](void *ptr){ delete static_cast<T *>(ptr); } }); }