I need to copy a vector of polymorphic objects, in the new vector there should be pointers to the same polymorphic types just not pointing to the same data, but instead they should point to new data on the heap. That data needs to be set to the same data as the original vector.
Example
std::vector < Component * > entity = baseEntity;
in this case the new vector entity just gets the pointers from baseEntity. Slicing doesn't occur here, but when I change the pointer in baseEntity it also changes the data in entity. How do I copy it correctly for my situation?