Ah, sorry, I thought it would have been automatically clear. Consider this example:
class A {
public:
A(int) {}
};
boost::multi_array<A,2> array(boost::extents[2][2]); // Compiler error
boost::multi_array<A,2> array(boost::extents[2][2], A(3)); // What I would like
array.resize(boost::extents[2][2]); // Again, compiler error
array.resize(boost::extents[2][2], A(2)); // What I would like
The variable `array` cannot be constructed in any way, as multi_array will try to default-construct it, and that will fail. Trying to simply create `array` with its default constructor works (although it will obviously be a zero-sized array), but when trying to resize it (to actually store things), the same thing will happen.
Using pointers could work, but it's simply not viable, as it requires me to do memory management manually. I simply do not wish to do so, and it kind of runs contrary to modern C++ practices. I could use `unique_ptr`, but it feels more convoluted than it should be (along with requiring an additional layer of unneeded indirection). I feel multi_array should be capable of being constructed from existing values, just as `std::vector` and other standard containers can do.
Would this be possible?