I have a class (C
) with a vector
of unique_ptr
s to an abstract class (A
) as a member. This is because C
must work with all classes of type A
, i.e. its children.
The problem is that I cannot figure out how to write a copy constructor for C
, since the type of the objects that the pointers are pointing to are not known at compile time. It actually seems impossible to me. Can anyone confirm that it is impossible? Do you have any suggestions on how to solve the problem? Is it too awful to have a class without a copy constructor?