This seems like a pretty basic problem, but I can\'t figure it out. I have a std::vector of raw pointers to Derived objects, and I just want to copy it to anot
std::vector
push_back performs element-wise conversions. The assignment operator exists only between vectors of the same type.
push_back
An easy solution is to use assign:
assign
v2.assign(v1.begin(), v1.end());