error C2665: 'std::_Copy_impl' of Boost library

Viewed 585

The whole error message is:

error C2665: 'std::_Copy_impl' : none of the 2 overloads could convert all the argument types (xutility)

You can download a demo project, which is written only for the purpose to demonstrate the issue during compilation in debug mode in Visual Studio 2010 or 2012.

I know that it seems to be a long-time bug [1] of Boost when using under Visual C++ 2010 in debug mode. Actually, by a lot of searching, this can be solved by modifying BOOST_PATH/boost/multi_array/view.hpp to something like:

multi_array_view& operator=(const multi_array_view& other) {
    if (&other != this) {
        // make sure the dimensions agree
        BOOST_ASSERT(other.num_dimensions() == this->num_dimensions());
        BOOST_ASSERT(std::equal(other.shape(),
            other.shape()+this->num_dimensions(),
            this->shape()));

#if _MSC_VER >= 1600
        auto
            iterThis = begin();
        auto
            iterOther = other.begin();
        for (; iterThis != end(); ++iterThis, ++iterOther)
            *iterThis = *iterOther;
#else
        // iterator-based copy
        std::copy(other.begin(),other.end(),begin());
#endif
    }
    return *this;
}

However, this only works for VS2010. The problem still exists for VS2012 in Debug mode even for latest v1.55.0. Any idea to work through this as my latest project need to be done in VS2012?

0 Answers
Related