Boost C++ Libraries: Ticket #12454: multi_array: operator= does not resize array https://svn.boost.org/trac10/ticket/12454 <p> Hello, </p> <p> the copy operator does not resize the array in contrast to the copy constructor, which does. That is a pitfall. </p> <p> In case of a multi_array_ref the size cannot be changed, but for a multi_array it can and it also should change the size. </p> <p> #include &lt;boost/multi_array.hpp&gt; </p> <p> int main() { </p> <blockquote> <p> boost::multi_array&lt;double, 2&gt; a(boost::extents<a class="changeset" href="https://svn.boost.org/trac10/changeset/3" title="Tweak disclaimer text">[3]</a><a class="changeset" href="https://svn.boost.org/trac10/changeset/4" title="Tweak disclaimer formatting, again">[4]</a>); boost::multi_array&lt;double, 2&gt; b = a; <em> ok boost::multi_array&lt;double, 2&gt; c; </em> has size <a class="missing changeset" title="No changeset 0 in the repository">[0]</a><a class="missing changeset" title="No changeset 0 in the repository">[0]</a> c = a; <em> fails </em></p> </blockquote> <blockquote> <p> return 0; </p> </blockquote> <p> } </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12454 Trac 1.4.3