Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

boost::multi_array resize error

Przemysław_O_
Beginner
591 Views

Hello,

I try to compile simple example from http://www.boost.org/doc/libs/1_61_0/libs/multi_array/doc/user.html#sec_resize

#include "stdafx.h"
#include <boost\multi_array.hpp>

int main()
{
    typedef boost::multi_array<int, 3> array_type;

    array_type::extent_gen extents;
    array_type A(extents[3][3][3]);
    A[0][0][0] = 4;
    A[2][2][2] = 5;
    A.resize(extents[2][3][4]);

    return 0;
}

and get following error with Intel C++ 2016 Update 3 under VC++ 2015 Update 2:

1>------ Build started: Project: multiarray, Configuration: Debug Win32 ------
1>  multiarray.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xutility(2313): error : no instance of overloaded function "std::_Copy_no_deprecate1" matches the argument list
1>              argument types are: (boost::detail::multi_array::array_iterator<int, const int *, boost::mpl::size_t<3U>, boost::detail::multi_array::const_sub_array<int, 2U, const int *>, boost::iterators::random_access_traversal_tag>, boost::detail::multi_array::array_iterator<int, const int *, boost::mpl::size_t<3U>, boost::detail::multi_array::const_sub_array<int, 2U, const int *>, boost::iterators::random_access_traversal_tag>, boost::detail::multi_array::array_iterator<int, int *,
1>                        boost::mpl::size_t<3U>, boost::detail::multi_array::sub_array<int, 2U>, boost::iterators::random_access_traversal_tag>, boost::iterators::detail::iterator_category_with_traversal<std::input_iterator_tag, boost::iterators::random_access_traversal_tag>, boost::iterators::detail::iterator_category_with_traversal<std::input_iterator_tag, boost::iterators::random_access_traversal_tag>)
1>    	return (_Copy_no_deprecate1(_Unchecked(_First), _Unchecked(_Last),
1>    	        ^
1>            detected during:
1>              instantiation of "_OutIt std::_Copy_no_deprecate(_InIt, _InIt, _OutIt) [with _InIt=boost::detail::multi_array::array_iterator<int, const int *, boost::mpl::size_t<3U>, boost::detail::multi_array::const_sub_array<int, 2U, const int *>, boost::iterators::random_access_traversal_tag>, _OutIt=boost::detail::multi_array::array_iterator<int, int *, boost::mpl::size_t<3U>, boost::detail::multi_array::sub_array<int, 2U>, boost::iterators::random_access_traversal_tag>]" at line 2323
1>              instantiation of "_OutIt std::copy(_InIt, _InIt, _OutIt) [with _InIt=boost::detail::multi_array::array_iterator<int, const int *, boost::mpl::size_t<3U>, boost::detail::multi_array::const_sub_array<int, 2U, const int *>, boost::iterators::random_access_traversal_tag>, _OutIt=boost::detail::multi_array::array_iterator<int, int *, boost::mpl::size_t<3U>, boost::detail::multi_array::sub_array<int, 2U>, boost::iterators::random_access_traversal_tag>]" at line 318 of
1>                        "c:\Users\oley\documents\visual studio 2015\Projects\multiarray\packages\boost.1.61.0.3\build\native\..\..\lib\native\include\boost/multi_array/view.hpp"
1>              instantiation of "boost::detail::multi_array::multi_array_view<T, NumDims> &boost::detail::multi_array::multi_array_view<T, NumDims>::operator=(const boost::detail::multi_array::multi_array_view<T, NumDims> &) [with T=int, NumDims=3U]" at line 447 of "c:\Users\oley\documents\visual studio 2015\Projects\multiarray\packages\boost.1.61.0.3\build\native\..\..\lib\native\include\boost\multi_array.hpp"
1>              instantiation of "boost::multi_array<T, NumDims, Allocator> &boost::multi_array<T, NumDims, Allocator>::resize(const boost::detail::multi_array::extent_gen<NumDims> &) [with T=int, NumDims=3U, Allocator=std::allocator<int>]" at line 16 of "multiarray.cpp"
1>
1>  compilation aborted for multiarray.cpp (code 2)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Without Intel C++ it works fine.

Greetings

Przemek

 

0 Kudos
4 Replies
Anoop_M_Intel
Employee
591 Views

Thanks Przemek for reporting this problem. I will try to reproduce this issue.

Regards
Anoop

 

0 Kudos
Doug_Weights_
Beginner
591 Views

Hi, thanks for looking into this. I have also seen this error quite a few times through our codebase. I am using  Intel C++ 2016 Update 3, VC++ 2015 Update 2 and Boost 1.60. I can confirm that the error doesn't occur with the Microsoft v120 and v140 compilers. 

0 Kudos
Przemysław_O_
Beginner
591 Views

Hi Anoop,

were you able to reproduce that issue. Have you gat any clue or better workaround?

Best regards

Przemek

0 Kudos
Przemysław_O_
Beginner
591 Views

Hi, it does not occure anymore after installing VS Update 3.

0 Kudos
Reply