On Thu, Feb 26, 2009 at 8:14 PM, alfC
Now that you mentionad the example of std::vector. I am wondering whether such manual control of multi_array reserved space is THE solution. something like
A.reserve({{shape1,shape2,shape3}}); // or just reserve (shape1*shape2*shape3)
Would this still make it necessary to write an operator= in a class that has a multi_array as a member? That's the main thing I'd like to avoid as it introduces a maintenance burden to ensure all the other members are copied. Because of that I think multi_array::operator= must be the exception to a strategy on avoiding reallocations. If the existing space can be used, then all well and good - have that optimisation. Thanks for explaining a bit more about multi_array and comparison of it with std::vector. Regards, Pete