Note that there are some explanatory texts on larger screens.

plurals
  1. POboost::multi_array resize doesn't work
    primarykey
    data
    text
    <p>I can't get boost::multi_array resizing to work. When I try it, it gives errors about std::_Copy_impl and the like. Here is the code</p> <pre><code>#include &lt;boost/multi_array.hpp&gt; typedef boost::multi_array&lt;int, 2&gt; array_type; class arrayclass{ public: arrayclass(array_type::extent_gen extents) : multiarray(extents[3][4]){ } array_type multiarray; }; int main(){ array_type::extent_gen extents; arrayclass arraytest(extents); arraytest.multiarray.resize(extents[5][6]); return 0; } </code></pre> <p>Edit: Here are the errors</p> <pre><code>1&gt;------ Build started: Project: multiarray, Configuration: Debug Win32 ------ 1&gt; main.cpp 1&gt;c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(2216): error C2665: 'std::_Copy_impl' : none of the 2 overloads could convert all the argument types 1&gt; c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(2182): could be '_OutIt std::_Copy_impl&lt;_InIt,_OutIt&gt;(_InIt,_InIt,_OutIt,std::input_iterator_tag,std::output_iterator_tag)' 1&gt; with 1&gt; [ 1&gt; _OutIt=boost::detail::multi_array::array_iterator&lt;int,int *,boost::mpl::size_t&lt;2&gt;,boost::detail::multi_array::sub_array&lt;int,1&gt;&gt;, 1&gt; _InIt=boost::detail::multi_array::array_iterator&lt;int,const int *,boost::mpl::size_t&lt;2&gt;,boost::detail::multi_array::const_sub_array&lt;int,1&gt;&gt; 1&gt; ] 1&gt; c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(2191): or '_OutIt std::_Copy_impl&lt;_InIt,_OutIt&gt;(_InIt,_InIt,_OutIt,std::random_access_iterator_tag,std::random_access_iterator_tag)' 1&gt; with 1&gt; [ 1&gt; _OutIt=boost::detail::multi_array::array_iterator&lt;int,int *,boost::mpl::size_t&lt;2&gt;,boost::detail::multi_array::sub_array&lt;int,1&gt;&gt;, 1&gt; _InIt=boost::detail::multi_array::array_iterator&lt;int,const int *,boost::mpl::size_t&lt;2&gt;,boost::detail::multi_array::const_sub_array&lt;int,1&gt;&gt; 1&gt; ] 1&gt; while trying to match the argument list '(boost::detail::multi_array::array_iterator&lt;T,TPtr,NumDims,Reference&gt;, boost::detail::multi_array::array_iterator&lt;T,TPtr,NumDims,Reference&gt;, boost::detail::multi_array::array_iterator&lt;T,TPtr,NumDims,Reference&gt;, boost::detail::iterator_category_with_traversal&lt;Category,Traversal&gt;, boost::detail::iterator_category_with_traversal&lt;Category,Traversal&gt;)' 1&gt; with 1&gt; [ 1&gt; T=int, 1&gt; TPtr=const int *, 1&gt; NumDims=boost::mpl::size_t&lt;2&gt;, 1&gt; Reference=boost::detail::multi_array::const_sub_array&lt;int,1&gt; 1&gt; ] 1&gt; and 1&gt; [ 1&gt; T=int, 1&gt; TPtr=const int *, 1&gt; NumDims=boost::mpl::size_t&lt;2&gt;, 1&gt; Reference=boost::detail::multi_array::const_sub_array&lt;int,1&gt; 1&gt; ] 1&gt; and 1&gt; [ 1&gt; T=int, 1&gt; TPtr=int *, 1&gt; NumDims=boost::mpl::size_t&lt;2&gt;, 1&gt; Reference=boost::detail::multi_array::sub_array&lt;int,1&gt; 1&gt; ] 1&gt; and 1&gt; [ 1&gt; Category=std::input_iterator_tag, 1&gt; Traversal=boost::random_access_traversal_tag 1&gt; ] 1&gt; and 1&gt; [ 1&gt; Category=std::input_iterator_tag, 1&gt; Traversal=boost::random_access_traversal_tag 1&gt; ] 1&gt; c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(2227) : see reference to function template instantiation '_OutIt std::_Copy_impl&lt;_Iter,_OutIt&gt;(_InIt,_InIt,_OutIt,std::tr1::false_type)' being compiled 1&gt; with 1&gt; [ 1&gt; _OutIt=boost::detail::multi_array::array_iterator&lt;int,int *,boost::mpl::size_t&lt;2&gt;,boost::detail::multi_array::sub_array&lt;int,1&gt;&gt;, 1&gt; _Iter=boost::detail::multi_array::array_iterator&lt;int,const int *,boost::mpl::size_t&lt;2&gt;,boost::detail::multi_array::const_sub_array&lt;int,1&gt;&gt;, 1&gt; _InIt=boost::detail::multi_array::array_iterator&lt;int,const int *,boost::mpl::size_t&lt;2&gt;,boost::detail::multi_array::const_sub_array&lt;int,1&gt;&gt; 1&gt; ] 1&gt; c:\boost_1_45_0\boost\multi_array\view.hpp(321) : see reference to function template instantiation '_OutIt std::copy&lt;boost::detail::multi_array::array_iterator&lt;T,TPtr,NumDims,Reference&gt;,boost::detail::multi_array::array_iterator&lt;T,T *,NumDims,boost::detail::multi_array::sub_array&lt;T,1&gt;&gt;&gt;(_InIt,_InIt,_OutIt)' being compiled 1&gt; with 1&gt; [ 1&gt; _OutIt=boost::detail::multi_array::array_iterator&lt;int,int *,boost::mpl::size_t&lt;2&gt;,boost::detail::multi_array::sub_array&lt;int,1&gt;&gt;, 1&gt; T=int, 1&gt; TPtr=const int *, 1&gt; NumDims=boost::mpl::size_t&lt;2&gt;, 1&gt; Reference=boost::detail::multi_array::const_sub_array&lt;int,1&gt;, 1&gt; _InIt=boost::detail::multi_array::array_iterator&lt;int,const int *,boost::mpl::size_t&lt;2&gt;,boost::detail::multi_array::const_sub_array&lt;int,1&gt;&gt; 1&gt; ] 1&gt; c:\boost_1_45_0\boost\multi_array\view.hpp(313) : while compiling class template member function 'boost::detail::multi_array::multi_array_view&lt;T,NumDims&gt; &amp;boost::detail::multi_array::multi_array_view&lt;T,NumDims&gt;::operator =(const boost::detail::multi_array::multi_array_view&lt;T,NumDims&gt; &amp;)' 1&gt; with 1&gt; [ 1&gt; T=int, 1&gt; NumDims=2 1&gt; ] 1&gt; c:\badprogramer\multiarray\multiarray\main.cpp(7) : see reference to class template instantiation 'boost::detail::multi_array::multi_array_view&lt;T,NumDims&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; T=int, 1&gt; NumDims=2 1&gt; ] ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload