I\'d like to have a vector of unique_ptr\'s as a member of a class I\'m making.
class Foo {
[...]
private:
vector> barList;
The problem here is that somewhere, your code is attempting to call the "copy-assignment" operator of Foo
.
This causes the compiler to attempt to generate a copy-assignment operator which calls the copy-assignment operators of all the subobjects of Foo
. Eventually, this leads to an attempt to copy a unique_ptr
, an operation which is not possible.