I'd like to store an object that contains a unique_ptr in a static container:
Class A
{
public:
A() {}
~A() {}
private:
unique_ptr<int> p;
};
static vector<A> vec = { A() };
But the code fails to compile, as class A is not copyable due to the unique ptr. How can I solve this, without having to define a copy constructor in class A that would perform a move operation on the pointer?