I'm programming in c++ and wondering if I should manually deallocate a 2d vector. For example:
class A{
private: vector<vector<int> > a;
public: A(vector<int> &input0,vector<int> &input1){
a.push_back(input0);
a.push_back(input1);
}
~A(){//should i do something here?}
}
int main(){
vector<int> a0(3);
vector<int> a1(3);
A my_A(a0,a1);
}
In this example, should I deconstruct the private variable a in the deconstructor of class A? If yes, how should I do that?