Let's say I have a vector of Base.
I want to convert it to a vector of Derived, where
Derived::Derive d(const Base&); is defined.
Is it possible to convert the vector of Base to a vector of Derived
without incurring the memory overhead of two copies of everything? If
these were vectors of the same kind, I could just use vector::swap, but
unfortunately not in this example.
Joseph
I want to convert it to a vector of Derived, where
Derived::Derive d(const Base&); is defined.
Is it possible to convert the vector of Base to a vector of Derived
without incurring the memory overhead of two copies of everything? If
these were vectors of the same kind, I could just use vector::swap, but
unfortunately not in this example.
Joseph
Comment