It looks to me like there is a regression with multi_array in boost 1.42
using the MSVC10 RC. The problem is when you assign a sub_array to an
array. This code works fine on MSVC9 and Intel 11.1 on windows.
Any easy patches that could fix this, or am I missing something?
#include
int main(int argc, char* argv[])
{
boost::multi_array f_values(boost::extents[5][6][7]); //A
boost::multidimensional object
boost::detail::multi_array::sub_array sub_f = f_values[2];
//Works
boost::multi_array sub_f2 = f_values[2]; //Fails, used to work
}
===============================
The error novel (ignoring the warning about unsafe iterators) is:
1>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> C:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\xutility(2182): could be '_OutIt
std::_Copy_impl<_InIt,_OutIt>(_InIt,_InIt,_OutIt,std::input_iterator_tag,std::output_iterator_tag)'
1> with
1> [
1>
_OutIt=boost::detail::multi_array::array_iterator,boost::detail::multi_array::sub_array>,
1>
_InIt=boost::detail::multi_array::array_iterator,boost::detail::multi_array::const_sub_array>
1> ]
1> C:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\xutility(2191): or '_OutIt
std::_Copy_impl<_InIt,_OutIt>(_InIt,_InIt,_OutIt,std::random_access_iterator_tag,std::random_access_iterator_tag)'
1> with
1> [
1>
_OutIt=boost::detail::multi_array::array_iterator,boost::detail::multi_array::sub_array>,
1>
_InIt=boost::detail::multi_array::array_iterator,boost::detail::multi_array::const_sub_array>
1> ]
1> while trying to match the argument list
'(boost::detail::multi_array::array_iterator,
boost::detail::multi_array::array_iterator,
boost::detail::multi_array::array_iterator,
boost::detail::iterator_category_with_traversal,
boost::detail::iterator_category_with_traversal)'
1> with
1> [
1> T=double,
1> TPtr=const double *,
1> NumDims=boost::mpl::size_t<2>,
1>
Reference=boost::detail::multi_array::const_sub_array
1> ]
1> and
1> [
1> T=double,
1> TPtr=const double *,
1> NumDims=boost::mpl::size_t<2>,
1>
Reference=boost::detail::multi_array::const_sub_array
1> ]
1> and
1> [
1> T=double,
1> TPtr=double *,
1> NumDims=boost::mpl::size_t<2>,
1> Reference=boost::detail::multi_array::sub_array
1> ]
1> and
1> [
1> Category=std::input_iterator_tag,
1> Traversal=boost::random_access_traversal_tag
1> ]
1> and
1> [
1> Category=std::input_iterator_tag,
1> Traversal=boost::random_access_traversal_tag
1> ]
1> C:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\include\xutility(2227) : see reference to function template
instantiation '_OutIt
std::_Copy_impl<_Iter,_OutIt>(_InIt,_InIt,_OutIt,std::tr1::false_type)'
being compiled
1> with
1> [
1>
_OutIt=boost::detail::multi_array::array_iterator,boost::detail::multi_array::sub_array>,
1>
_Iter=boost::detail::multi_array::array_iterator,boost::detail::multi_array::const_sub_array>,
1>
_InIt=boost::detail::multi_array::array_iterator,boost::detail::multi_array::const_sub_array>
1> ]
1> C:\working\libraries\boost\boost/multi_array.hpp(337) : see
reference to function template instantiation '_OutIt
std::copy,boost::detail::multi_array::array_iterator>>(_InIt,_InIt,_OutIt)'
being compiled
1> with
1> [
1>
_OutIt=boost::detail::multi_array::array_iterator,boost::detail::multi_array::sub_array>,
1> T=double,
1> TPtr=const double *,
1> NumDims=boost::mpl::size_t<2>,
1>
Reference=boost::detail::multi_array::const_sub_array,
1>
_InIt=boost::detail::multi_array::array_iterator,boost::detail::multi_array::const_sub_array>
1> ]
1> C:\working\libraries\boost\boost/multi_array.hpp(332) : while
compiling class template member function
'boost::multi_array::multi_array(const
boost::detail::multi_array::sub_array &)'
1> with
1> [
1> T=double,
1> NumDims=2
1> ]
1> ..\test.cpp(14) : see reference to class template instantiation
'boost::multi_array' being compiled
1> with
1> [
1> T=double,
1> NumDims=2
1> ]