I have got a problem understanding the copy constructor implementation of boost::multi_:array.
When I try the following
std::vector<double> a;
std::vector<double> b;
a.resize(12);
b.resize(10);
a=b;
everything works out fine,
but when I try
boost::multi_array<double,1> a;
boost::multi_array<double,1> b;
a.resize(boost::extents[12]);
b.resize(boost::extents[10]);
a=b;
I get a crash.
I expected the same behaviour, but I also could not find anything useful in the documentation.
Does anyone have an idea ?
Regards
awallrab
It looks like boost::multi_array works just like std::valarray regarding assignment, that is the size of the 2 arrays must match.
According to the documentation:
Each of the array types
multi_array,multi_array_ref,subarray, andarray_viewcan be assigned from any of the others, so long as their shapes match.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With