Let's say I have a multidimension array, which in C99 I could write like this:
#define SIZE1 10
int size2;
[...]
int myArray[SIZE1][size2];
Although supported by several compilers, this is not strictly C++, and won't be included until C++14. To obtain the same (apart stack/heap problem irrelevant for my case) using boost::scoped_array, I write:
boost::scoped_array<int> myArray[SIZE1];
for (int i = 0; i < SIZE1; i++)
myArray[i].reset(new int[size2]);
So, not so concise expression. Am I missing something, or for multidimension arrays with variable length there is no easy plain C++ way to obtain a quick allocation?
Some reference: Why aren't variable-length arrays part of the C++ standard?