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?
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?
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