[repost][multiarray] Bug with boost::detail::multi_array::array_iterator on MSVC 2010RC?

Sorry for the repost, but I am pretty sure this is a bug with the MSVC standard library integration to multi_array. It could also be related to boost::iterator The following code worked on MSVC 2008, Intel 11.1 on Windows, and MinGW, ... but is failing to compile on the MSVC 2010RC. I tested this against boost 1.42 and the boost trunk from SVN. #pragma warning(disable:4996) //Tough to see errors otherwise. #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 on MSVC10, works on all others } ////////////////// The problem here is with the constructor in multi_array.hpp around line 334. It uses an std::copy, However, if I replace the: std::copy(rhs.begin(),rhs.end(),this->begin()); with the (godawful) direct iteration: auto p_rhs = rhs.begin(); auto p_this = this->begin(); while(p_rhs < rhs.end()) { *p_this = *p_rhs; ++p_rhs; ++p_this; } Things compile fine. Also note, that this same problem with the std::copy happens in pretty much every other constructor/place it is used in this library. (i.e. all over the place, so this 'hack' is pretty useless). It appears to me that the MSVC's STD implementation isn't finding a match a std::copy overload impl with the iterators as: Input iterator as: boost::detail::multi_array::array_iterator<double,const double *,boost::mpl::size_t<2>,boost::detail::multi_array::const_sub_array<double,1>> Output iterator as: boost::detail::multi_array::array_iterator<double,double *,boost::mpl::size_t<2>,boost::detail::multi_array::sub_array<double,1>>, I have attached my test files. Any ideas or patches would be appreciated

Jesse Perla wrote:
Sorry for the repost, but I am pretty sure this is a bug with the MSVC standard library integration to multi_array. It could also be related to boost::iterator
The following code worked on MSVC 2008, Intel 11.1 on Windows, and MinGW, ... but is failing to compile on the MSVC 2010RC. [snip] I have attached my test files. Any ideas or patches would be appreciated
Hi Jesse, since it's you, and it's a repost, and I installed the MSVC 2010beta2 anyway (and since this sound similar to the issue you found in ublas), I will take a look at it. If you already know that it's only reproducible with MSVC 2010RC and not with MSVC 2010beta2, please tell me straight away. Regards, Thomas

Thomas Klimpel <Thomas.Klimpel <at> synopsys.com> writes: Much appreciated Thomas, It also think it looks suspiciously similar to the one we found with ublas. Sadly, I don't have the beta 2 installed but since the other problem occured on both RC and Beta2, hopefully this will as well. -Jesse
participants (2)
-
Jesse Perla
-
Thomas Klimpel