1 min readOct 6, 2019
Answer — this cannot be done without more information about the ownership and nullability of m_data
.
If VecOfInts
doesn’t own m_data
at all then these methods could be the same as the copy constructor and assignment operator.
If VecOfInts
owns m_data
but that field is not nullable then you’d unfortunately have to do some sort of ugliness to put something into the m_data
that you have moved out of.
Only if m_data
is owned by VecOfInts
and is nullable can you actually “move” in any neat fashion.