1

I have searched this a little bit but couldn't find a similar example so I wanted to ask just to be sure. If I have a class with no explicit heap allocation but only STL classes like so:

class Klass {
..
private:
  vector<int> v;
};

Does default move constructor provide me the proper move semantics for free, that is something similar to Klass(Klass&& other) : v(move(other.v)) { .. }?

Niall
  • 30,036
  • 10
  • 99
  • 142
none
  • 11,793
  • 9
  • 51
  • 87

0 Answers0