15 #ifndef BORNAGAIN_BASE_TYPES_CLONEABLEVECTOR_H
16 #define BORNAGAIN_BASE_TYPES_CLONEABLEVECTOR_H
32 using super = std::vector<std::unique_ptr<T>>;
38 super::reserve(other.size());
39 for (
const std::unique_ptr<T>& t : other)
40 super::emplace_back(t->clone());
42 void push_back(T* t) { super::emplace_back(std::unique_ptr<T>(t)); }
43 void emplace_back(std::unique_ptr<T>&& t) { super::emplace_back(t); }
A vector of unique pointers to objects that are cloneable.
CloneableVector(const CloneableVector &other)
void emplace_back(std::unique_ptr< T > &&t)
std::vector< std::unique_ptr< T > > super