|
Boost Users : |
Subject: [Boost-users] [multiarray] Regression with MSVC10 assigning sub-array to array?
From: Jesse Perla (jesseperla_at_[hidden])
Date: 2010-03-11 11:17:25
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 <boost/multi_array.hpp>
int main(int argc, char* argv[])
{
boost::multi_array<double, 3> f_values(boost::extents[5][6][7]); //A
boost::multidimensional object
boost::detail::multi_array::sub_array<double, 2> sub_f = f_values[2];
//Works
boost::multi_array<double, 2> 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<double,double
*,boost::mpl::size_t<2>,boost::detail::multi_array::sub_array<double,1>>,
1>
_InIt=boost::detail::multi_array::array_iterator<double,const double
*,boost::mpl::size_t<2>,boost::detail::multi_array::const_sub_array<double,1>>
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<double,double
*,boost::mpl::size_t<2>,boost::detail::multi_array::sub_array<double,1>>,
1>
_InIt=boost::detail::multi_array::array_iterator<double,const double
*,boost::mpl::size_t<2>,boost::detail::multi_array::const_sub_array<double,1>>
1> ]
1> while trying to match the argument list
'(boost::detail::multi_array::array_iterator<T,TPtr,NumDims,Reference>,
boost::detail::multi_array::array_iterator<T,TPtr,NumDims,Reference>,
boost::detail::multi_array::array_iterator<T,TPtr,NumDims,Reference>,
boost::detail::iterator_category_with_traversal<Category,Traversal>,
boost::detail::iterator_category_with_traversal<Category,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<double,1>
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<double,1>
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<double,1>
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<double,double
*,boost::mpl::size_t<2>,boost::detail::multi_array::sub_array<double,1>>,
1>
_Iter=boost::detail::multi_array::array_iterator<double,const double
*,boost::mpl::size_t<2>,boost::detail::multi_array::const_sub_array<double,1>>,
1>
_InIt=boost::detail::multi_array::array_iterator<double,const double
*,boost::mpl::size_t<2>,boost::detail::multi_array::const_sub_array<double,1>>
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<T,TPtr,NumDims,Reference>,boost::detail::multi_array::array_iterator<T,T
*,NumDims,boost::detail::multi_array::sub_array<T,1>>>(_InIt,_InIt,_OutIt)'
being compiled
1> with
1> [
1>
_OutIt=boost::detail::multi_array::array_iterator<double,double
*,boost::mpl::size_t<2>,boost::detail::multi_array::sub_array<double,1>>,
1> T=double,
1> TPtr=const double *,
1> NumDims=boost::mpl::size_t<2>,
1>
Reference=boost::detail::multi_array::const_sub_array<double,1>,
1>
_InIt=boost::detail::multi_array::array_iterator<double,const double
*,boost::mpl::size_t<2>,boost::detail::multi_array::const_sub_array<double,1>>
1> ]
1> C:\working\libraries\boost\boost/multi_array.hpp(332) : while
compiling class template member function
'boost::multi_array<T,NumDims>::multi_array(const
boost::detail::multi_array::sub_array<T,2> &)'
1> with
1> [
1> T=double,
1> NumDims=2
1> ]
1> ..\test.cpp(14) : see reference to class template instantiation
'boost::multi_array<T,NumDims>' being compiled
1> with
1> [
1> T=double,
1> NumDims=2
1> ]
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net