Domanda

How to free allocated memory for a Boost multi-array?

There is no clear, or free, or delete member function in its interface. I have a 3-dimensional array, and currently, I am doing resize to [0,0,0] extents to free up memory. But, is there a better way to free memory for my 3D array?

È stato utile?

Soluzione

Resizing to zero extents sounds entirely satisfactory and reasonable.

After all, this is /also/ the only interface available to allocate the memory in the first place.

If you prefer, you could make a free function to do the jobs hiding the implementation detail.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top