I'm having a multidimensional std::array and looking for the proper (convenient and efficient) way to find its size (in number of cells or in bytes)
size() returns only the last dimension size (which is understood)
std::array<std::array<std::array<std::array<double, 2>, 3>, 6>, 100> my_array;
my_array.size(); // returns 100
I wish to avoid #define SIZE_OF_MY_ARRAY or to calculate it every time, if possible.
How can I find the overall size of my_array?
Thanks.
Aucun commentaire:
Enregistrer un commentaire