jeudi 12 mars 2015

Default move constructor

I have a class like



class MyMatrix {
public:
MyMatrix() = default;
MyMatrix(const MyMatrix&) = default;
~MyMatrix() = default;

// some custom methods..

private:
std::vector<float> data;
}


since I have all my data in a vector I thought that RAII should take care of the memory.


My question is: should I also include a MyMatrix(MyMatrix&&) = default; line? Would my code benefit from this at all or would I do something wrong if I did?


Aucun commentaire:

Enregistrer un commentaire