Reputation: 1901
a 2D and 3D array vectors are defined and used throughout a simulation, they are very large in size so deallocation is neccesary.
array<vector<double>, n> A;
array<vector<vector<double>, n>, m> B;
what is the proper way?
Upvotes: 0
Views: 58
Reputation: 16334
just let them go out of scope:
{
array<vector<double>, n> A;
array<vector<vector<double>, n>, m> B;
// use arrays ...
} // leave scope, arrays will be deallocated
Upvotes: 3