Boost C++ Libraries: Ticket #4874: multi_array compile errors using Visual C++ 2010 in debug mode https://svn.boost.org/trac10/ticket/4874 <p> This is a long standing problem and it should have been fixes already <a class="changeset" href="https://svn.boost.org/trac10/changeset/1" title="Import core sources for SVNmanger 0.38 ">[1]</a>, but in boost release 1.45 it still exists. </p> <p> When using a multi_array and engaging the copy constructor or assignment operator of a multi_array in debug mode on Visual C++ 2010 the following errors are generated. This was done using the boost 1.45 release on Visual C++ 2010 on Windows 7 x64 targeting a x64 build: </p> <pre class="wiki">1&gt;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&gt; C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility(2182): could be '_OutIt std::_Copy_impl&lt;_InIt,_OutIt&gt;(_InIt,_InIt,_OutIt,std::input_iterator_tag,std::output_iterator_tag)' 1&gt; with 1&gt; [ 1&gt; _OutIt=boost::detail::multi_array::array_iterator&lt;char,char *,boost::mpl::size_t&lt;0x02&gt;,boost::detail::multi_array::sub_array&lt;char,0x01&gt;&gt;, 1&gt; _InIt=boost::detail::multi_array::array_iterator&lt;char,const char *,boost::mpl::size_t&lt;0x02&gt;,boost::detail::multi_array::const_sub_array&lt;char,0x01&gt;&gt; 1&gt; ] 1&gt; C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility(2191): or '_OutIt std::_Copy_impl&lt;_InIt,_OutIt&gt;(_InIt,_InIt,_OutIt,std::random_access_iterator_tag,std::random_access_iterator_tag)' 1&gt; with 1&gt; [ 1&gt; _OutIt=boost::detail::multi_array::array_iterator&lt;char,char *,boost::mpl::size_t&lt;0x02&gt;,boost::detail::multi_array::sub_array&lt;char,0x01&gt;&gt;, 1&gt; _InIt=boost::detail::multi_array::array_iterator&lt;char,const char *,boost::mpl::size_t&lt;0x02&gt;,boost::detail::multi_array::const_sub_array&lt;char,0x01&gt;&gt; 1&gt; ] 1&gt; while trying to match the argument list '(boost::detail::multi_array::array_iterator&lt;T,TPtr,NumDims,Reference&gt;, boost::detail::multi_array::array_iterator&lt;T,TPtr,NumDims,Reference&gt;, boost::detail::multi_array::array_iterator&lt;T,TPtr,NumDims,Reference&gt;, boost::detail::iterator_category_with_traversal&lt;Category,Traversal&gt;, boost::detail::iterator_category_with_traversal&lt;Category,Traversal&gt;)' 1&gt; with 1&gt; [ 1&gt; T=char, 1&gt; TPtr=const char *, 1&gt; NumDims=boost::mpl::size_t&lt;0x02&gt;, 1&gt; Reference=boost::detail::multi_array::const_sub_array&lt;char,0x01&gt; 1&gt; ] 1&gt; and 1&gt; [ 1&gt; T=char, 1&gt; TPtr=const char *, 1&gt; NumDims=boost::mpl::size_t&lt;0x02&gt;, 1&gt; Reference=boost::detail::multi_array::const_sub_array&lt;char,0x01&gt; 1&gt; ] 1&gt; and 1&gt; [ 1&gt; T=char, 1&gt; TPtr=char *, 1&gt; NumDims=boost::mpl::size_t&lt;0x02&gt;, 1&gt; Reference=boost::detail::multi_array::sub_array&lt;char,0x01&gt; 1&gt; ] 1&gt; and 1&gt; [ 1&gt; Category=std::input_iterator_tag, 1&gt; Traversal=boost::random_access_traversal_tag 1&gt; ] 1&gt; and 1&gt; [ 1&gt; Category=std::input_iterator_tag, 1&gt; Traversal=boost::random_access_traversal_tag 1&gt; ] 1&gt; C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xutility(2227) : see reference to function template instantiation '_OutIt std::_Copy_impl&lt;_Iter,_OutIt&gt;(_InIt,_InIt,_OutIt,std::tr1::false_type)' being compiled 1&gt; with 1&gt; [ 1&gt; _OutIt=boost::detail::multi_array::array_iterator&lt;char,char *,boost::mpl::size_t&lt;0x02&gt;,boost::detail::multi_array::sub_array&lt;char,0x01&gt;&gt;, 1&gt; _Iter=boost::detail::multi_array::array_iterator&lt;char,const char *,boost::mpl::size_t&lt;0x02&gt;,boost::detail::multi_array::const_sub_array&lt;char,0x01&gt;&gt;, 1&gt; _InIt=boost::detail::multi_array::array_iterator&lt;char,const char *,boost::mpl::size_t&lt;0x02&gt;,boost::detail::multi_array::const_sub_array&lt;char,0x01&gt;&gt; 1&gt; ] 1&gt; E:\working_copies\schism_x64\externals_vc100\inc\boost\boost/multi_array/multi_array_ref.hpp(489) : see reference to function template instantiation '_OutIt std::copy&lt;boost::detail::multi_array::array_iterator&lt;T,TPtr,NumDims,Reference&gt;,boost::detail::multi_array::array_iterator&lt;T,T *,NumDims,boost::detail::multi_array::sub_array&lt;T,0x01&gt;&gt;&gt;(_InIt,_InIt,_OutIt)' being compiled 1&gt; with 1&gt; [ 1&gt; _OutIt=boost::detail::multi_array::array_iterator&lt;char,char *,boost::mpl::size_t&lt;0x02&gt;,boost::detail::multi_array::sub_array&lt;char,0x01&gt;&gt;, 1&gt; T=char, 1&gt; TPtr=const char *, 1&gt; NumDims=boost::mpl::size_t&lt;0x02&gt;, 1&gt; Reference=boost::detail::multi_array::const_sub_array&lt;char,0x01&gt;, 1&gt; _InIt=boost::detail::multi_array::array_iterator&lt;char,const char *,boost::mpl::size_t&lt;0x02&gt;,boost::detail::multi_array::const_sub_array&lt;char,0x01&gt;&gt; 1&gt; ] 1&gt; E:\working_copies\schism_x64\externals_vc100\inc\boost\boost/multi_array.hpp(377) : see reference to function template instantiation 'boost::multi_array_ref&lt;T,NumDims&gt; &amp;boost::multi_array_ref&lt;T,NumDims&gt;::operator =&lt;boost::multi_array&lt;T,0x02&gt;&gt;(const ConstMultiArray &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; T=char, 1&gt; NumDims=0x02, 1&gt; ConstMultiArray=boost::multi_array&lt;char,0x02&gt; 1&gt; ] 1&gt; E:\working_copies\schism_x64\externals_vc100\inc\boost\boost/multi_array.hpp(375) : while compiling class template member function 'boost::multi_array&lt;T,NumDims&gt; &amp;boost::multi_array&lt;T,NumDims&gt;::operator =(const boost::multi_array&lt;T,NumDims&gt; &amp;)' 1&gt; with 1&gt; [ 1&gt; T=char, 1&gt; NumDims=0x02 1&gt; ] 1&gt; e:\working_copies\schism_x64\schism\scm_gl_util\src\scm\gl_util\font\font_face.h(60) : see reference to class template instantiation 'boost::multi_array&lt;T,NumDims&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; T=char, 1&gt; NumDims=0x02 1&gt; ] </pre><p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/1" title="Import core sources for SVNmanger 0.38 ">[1]</a> <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/4539"><span class="icon">​</span>https://svn.boost.org/trac/boost/ticket/4539</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4874 Trac 1.4.3 Marshall Clow Wed, 19 Jan 2011 19:37:23 GMT <link>https://svn.boost.org/trac10/ticket/4874#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:1</guid> <description> <p> Does this problem still exist? (My copy of VS 2010 is on order) </p> </description> <category>Ticket</category> </item> <item> <author>johan.seland@…</author> <pubDate>Fri, 25 Feb 2011 21:14:56 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:2</guid> <description> <p> Yes. </p> <p> This problem still exist when compiling in debug mode. </p> <p> The final patch in <a class="changeset" href="https://svn.boost.org/trac10/changeset/1" title="Import core sources for SVNmanger 0.38 ">[1]</a> does not solve the problem, and triggers warnings of the type: </p> <p> <code>c:\program files (x86)\microsoft visual studio 10.0\vc\include\xutility(478): warning C4700: uninitialized local variable '_Cat' used</code> </p> </description> <category>Ticket</category> </item> <item> <author>Paul.Choudhury@…</author> <pubDate>Fri, 29 Apr 2011 15:55:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:3</guid> <description> <p> I am in the process of porting my application to VS2010 and Boost v1.46.1. My apps usage of boost::multi_array&lt;double,3&gt; is triggering the error described here. When can I expect a patch that works? I really need multi_array to work in both release and debug modes. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sun, 01 May 2011 18:17:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:4</guid> <description> <p> I confirm this bug in 1.46.1 version. My code did compile perfectly in VS2008 and does not in VS2010 debug mode (32 bits) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 10 May 2011 14:32:03 GMT</pubDate> <title>version changed https://svn.boost.org/trac10/ticket/4874#comment:5 https://svn.boost.org/trac10/ticket/4874#comment:5 <ul> <li><strong>version</strong> <span class="trac-field-old">Boost 1.45.0</span> → <span class="trac-field-new">Boost 1.47.0</span> </li> </ul> <p> I can confirm this bug in boost version 1.47. </p> Ticket r.undheim@… Tue, 07 Jun 2011 13:14:28 GMT <link>https://svn.boost.org/trac10/ticket/4874#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:6</guid> <description> <p> You could try to path code with problem (in view.hpp) to something like: </p> <pre class="wiki"> multi_array_view&amp; operator=(const multi_array_view&amp; other) { if (&amp;other != this) { // make sure the dimensions agree BOOST_ASSERT(other.num_dimensions() == this-&gt;num_dimensions()); BOOST_ASSERT(std::equal(other.shape(), other.shape()+this-&gt;num_dimensions(), this-&gt;shape())); #if _MSC_VER &gt;= 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; } </pre><p> Just to get the code through compiler, and wait for a proper fix later. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 01 Aug 2011 18:32:32 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:7</guid> <description> <p> This bug still exists and is preventing our builds in debug mode. Is there a chance it will be fixed? As always, thanks for what you do! :) </p> </description> <category>Ticket</category> </item> <item> <author>Dr. Sergey Kiselev <SergK13@…></author> <pubDate>Thu, 08 Sep 2011 10:10:44 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:8</guid> <description> <p> The same behavior is with all boost versions started at least from 1.33.1 up to the latest one (1.47.0). Is anybody dealing with it? It doesn't look like that is going to be fixed. Why then boost reports that it compatible with VS2010 ??? </p> </description> <category>Ticket</category> </item> <item> <author>anonymous@…</author> <pubDate>Thu, 15 Sep 2011 09:41:50 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:9</guid> <description> <p> I was having the same problem. During compilation I got these warnings as well: </p> <pre class="wiki">1&gt;c:\program files\microsoft visual studio 10.0\vc\include\xutility(478): warning C4700: uninitialized local variable '_Cat' used </pre><p> When I ran the application it crashed at the std::copy() in view.hpp but<strong> also in subarray.hpp</strong>. I had to apply the change suggested by r.undheim to both files and now it runs. </p> <p> Thanks! </p> </description> <category>Ticket</category> </item> <item> <author>Dr. Sergey Kiselev <SergK13Stuff@…></author> <pubDate>Thu, 15 Sep 2011 10:49:56 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:10</guid> <description> <p> There is a comment from Microsoft support: </p> <p> <a class="ext-link" href="http://connect.microsoft.com/VisualStudio/feedback/details/687655/compilation-issue-in-debug-mode-with-boost-library"><span class="icon">​</span>http://connect.microsoft.com/VisualStudio/feedback/details/687655/compilation-issue-in-debug-mode-with-boost-library</a> </p> <p> (IDL refers to _ITERATOR_DEBUG_LEVEL, which is 0 in release mode and 2 in debug mode.) </p> <p> -- The problem is that multi_array iterators report themselves as input iterators, which can't be written to (e.g. as the destination of a copy()). Under IDL=0, copy() doesn't actually care how its destination iterator is marked with an iterator category tag, it just tries to write to the destination iterator, and that works. Under IDL &gt; 0, copy() wants to know whether its source and destination iterators are both random-access, in which case it can perform a range check and unwrap the destination iterator for increased performance. It does this by overloading foo(input_iterator_tag, output_iterator_tag) and foo(random_access_iterator_tag, random_access_iterator_tag) and calling foo(category(source), category(destination)). If both source and destination are random-access, both overloads are viable (i.e. callable) and the second overload is preferred, so it's actually called. Otherwise, source is required to be at least an input iterator (maybe stronger) and destination is required to be at least an output iterator (maybe stronger) so the first overload must be viable and the second overload will be non-viable, so the first overload wins by default. </p> <p> However, if the destination is not marked as an output iterator or stronger, then the first overload is non-viable as well as the second, so overload resolution fails and boom. </p> <p> Stephan T. Lavavej Visual C++ Libraries Developer </p> <p> -- </p> <p> So based on that comment I only can add the only solution would be the one provided by r.undheim. </p> <p> And again all version of boost do not compatible with Visual Studio 2010 (till 1.47.0 at least). </p> </description> <category>Ticket</category> </item> <item> <author>hegsie@…</author> <pubDate>Fri, 16 Sep 2011 13:23:53 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:11</guid> <description> <p> Does anyone know of a timeline for the fix for this issue? Is it a serious change or just a patch? Cheers </p> </description> <category>Ticket</category> </item> <item> <author>istanbul.tr@…</author> <pubDate>Thu, 13 Oct 2011 03:14:49 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:12</guid> <description> <p> Here is another workaround (and a probably more general fix): </p> <ul><li>Open <code>boost/multi_array/iterator.hpp</code> </li><li>Replace first occurrence of <code>boost::random_access_traversal_tag</code> (Line 57 in version 1.47.0) with <code>std::random_access_iterator_tag</code> </li><li>Search second (line 75), replace that whole <code>typedef</code> with <pre class="wiki"> typedef typename array_iterator::iterator_facade_ facade_type; </pre></li></ul><p> hth </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 07 Nov 2011 16:55:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:13 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:13</guid> <description> <p> Can anybody confirm that istanbul.tr's fix works and is standards complaint? Hopefully there will be an official fix soon as this issue essentially prevents multi_array from being used in any code that needs to be compatible with VS2010 debug builds. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 09 Nov 2011 20:45:17 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:14 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:14</guid> <description> <p> Not sure whether it is 100% standard compatible but it works well in the VS2010 debug mode. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ronald Garcia</dc:creator> <pubDate>Sat, 07 Jan 2012 19:46:53 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:15 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:15</guid> <description> <p> istanbul.tr's fix is most definitely not a safe fix. Your code may crash at runtime. see <a class="ext-link" href="https://svn.boost.org/trac/boost/ticket/4539"><span class="icon">​</span>https://svn.boost.org/trac/boost/ticket/4539</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ronald Garcia</dc:creator> <pubDate>Tue, 10 Jan 2012 03:31:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:16 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:16</guid> <description> <p> I have checked a possible fix into the trunk of boost. I would appreciate feedback on whether the changes fix the problem. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ronald Garcia</dc:creator> <pubDate>Wed, 11 Jan 2012 02:52:37 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:17 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:17</guid> <description> <p> After looking into this some more, VC++ 2010 may be incorrect in its implementation of copy. Due to some ambiguity in the C++ standard, it appears that any iterator that satisfies input_iterator or less can be an output_iterator without having an iterator_category that is convertible to output_iterator_tag. It turns out that random_access_iterator_tag and friends are not convertible to output_iterator_tag, and the standard simply says that an iterator must have as its tag its most specific tag. output_iterator_tag gets used in the standard for things like back_insert_iterator, which are not even input_iterators. Observe that the Boost Concept checking library does no iterator_category checking whatsoever for the <a class="missing wiki">OutputIterator</a> Concept. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Bill Buklis</dc:creator> <pubDate>Wed, 08 Feb 2012 21:23:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:18 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:18</guid> <description> <p> So far the version in the trunk works for me. It compiles clean and seems to work as intended. Can this version be put in to the 1.49 beta? Currently 1.49 is using the old broken version. I'd hate for this issue to continue in yet another boost release. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ronald Garcia</dc:creator> <pubDate>Thu, 09 Feb 2012 23:55:50 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:19 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:19</guid> <description> <p> Before I commit this change to a release I would like to be sure that the current trunk changes are not covering what might actually be an error in VC++ 2010. It may well be that VC is incorrect in requiring that an iterator have output_iterator_tag as its category. The standard seems ambiguous about this. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 13 Feb 2012 20:18:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:20 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:20</guid> <description> <p> I have asked about this issue on comp.std.c++, and from what I have heard so far, my concerns about Visual C++'s current behavior and my potential "fix" for multi_array are justified. The C++ standard is ambiguous around these issues. The most relevant text that I can find in my copy of a standard draft, (24.3.3) says: For every iterator of type Iterator, iterator_traits&lt;Iterator&gt;::iterator_category shall be defined to be the most specific category tag that describes the iterator’s behavior. </p> <p> It appears that the intent of the standard suggests: </p> <p> 1) That the iterator category specifically BE an instance of one of the iterator tags, not simply CONVERTIBLE TO one. This makes my potential fix of providing an input_output_iterator_tag illegal. </p> <p> 2) On this basis, it appears that output_iterator_tag plays the role of a placeholder, and not a normative requirement. Looking further at the standard, the classes that have output_iterator_tag as their category are classes like back_inserter and ostream_iterator, that do not satisfy the requirements of ANY OTHER iterator category, but since they are required by the above text to have an iterator tag, it simply must be output_iterator_tag, because otherwise they would violate the standard by not having a tag or having a non-applicable tag. As such, it seems that output_iterator_tag just fills that space and is otherwise non-normative. </p> <p> By this interpretation, Visual C++'s debug-mode implementation is incorrect because checking for output_iterator_tag is not a requirement of an output iterator, it's just something that is true when an iterator is ONLY an output iterator and thus not qualified to have any other tag. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Bill Buklis</dc:creator> <pubDate>Wed, 22 Feb 2012 17:52:49 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/4874#comment:21 https://svn.boost.org/trac10/ticket/4874#comment:21 <ul> <li><strong>cc</strong> <span class="trac-author">Bill Buklis</span> added </li> </ul> <p> You're probably right as I know that VS2005 and VS2008 were overzealous and would break otherwise good code with there excessive debug checking. I remember having to add extra overloads to function objects just to satisfy the debug checking. </p> <p> Has this issue been raised on Microsoft's connect as a potential bug? Hopefully they'll fix it for the next VS version. </p> <p> On the other hand, even if it may be technically incorrect, I would still like it to work. Right now it's practically unusable without this "fix". Perhaps it can be put in as a conditional compile workaround just for VS2010 (or at least VS2010 debug). </p> Ticket Ronald Garcia Thu, 23 Feb 2012 14:38:27 GMT <link>https://svn.boost.org/trac10/ticket/4874#comment:22 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:22</guid> <description> <p> This issue has not been raised with Microsoft. It would be great if someone could contact the proper authorities on this matter. Also, I'm quite busy right now, and 1.49 is all but out the door, so a fix will likely have to wait for 1.50. If you could propose a patch against the current release branch based on the code in the trunk, that would be helpful. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 20 Mar 2012 06:38:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:23 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:23</guid> <description> <p> Additional comments regarding this issue from the mailing list: </p> <p> <a class="ext-link" href="http://lists.boost.org/Archives/boost/2012/01/189715.php"><span class="icon">​</span>http://lists.boost.org/Archives/boost/2012/01/189715.php</a> </p> </description> <category>Ticket</category> </item> <item> <author>baertman@…</author> <pubDate>Wed, 11 Apr 2012 10:54:45 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:24 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:24</guid> <description> <p> So what's the best workaround around this issue at the moment? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Bill Buklis</dc:creator> <pubDate>Wed, 11 Apr 2012 19:40:02 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/4874 https://svn.boost.org/trac10/ticket/4874 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">base.hpp</span> </li> </ul> <p> MSVC version check for output_iterator_tag (merge with trunk version) </p> Ticket Bill Buklis Wed, 11 Apr 2012 19:47:55 GMT <link>https://svn.boost.org/trac10/ticket/4874#comment:25 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:25</guid> <description> <p> I'm using the updated version from the trunk. This works fine. I attached a slightly modified version of the base.hpp file. You will need the rest of the files from trunk in addition to this file. The only modification is to check for the MSVC version. This way if you're not using MSVC it should act as normal. </p> <p> This is the updated section: </p> <pre class="wiki">struct mutable_iterator_tag : boost::random_access_traversal_tag, std::input_iterator_tag { #if BOOST_WORKAROUND(BOOST_MSVC, &lt;= 1700) operator std::output_iterator_tag() const { return std::output_iterator_tag(); } #endif }; </pre><p> The only thing I added was the BOOST_WORKAROUND if check. </p> <p> Note: I made the output_iterator_tag modification/addition valid for all Visual Studio versions up to and including the next version (VC11) as judging from the mailing list thread mentioned previously this bug may still be in there. I have not yet tried VC11, so I do not know if they have fixed it. Regardless, it shouldn't hurt anything. </p> <p> Thoughts? Comments? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Bill Buklis</dc:creator> <pubDate>Wed, 11 Apr 2012 21:01:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:26 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:26</guid> <description> <p> I also updated iterator.hpp to fix a problem with iterator derefencing. See <a class="new ticket" href="https://svn.boost.org/trac10/ticket/6554" title="#6554: Bugs: Compiler error dereferencing multi_array value via an iterator (new)">ticket:6554</a>. You may wish to get this file as well. Hopefully both of these patches can be added to the general release. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 12 Apr 2012 08:31:27 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:27 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:27</guid> <description> <p> I'm still getting </p> <pre class="wiki">error C2665: 'std::_Copy_impl' : none of the 2 overloads could convert all the argument types </pre><p> with the trunk version. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Bill Buklis</dc:creator> <pubDate>Thu, 12 Apr 2012 17:33:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:28 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:28</guid> <description> <p> First let's make sure that you have the right version of the multi_array headers (located in the boost/multi_array folder). There are only three files that are different from the regular release: </p> <ul><li>base.hpp </li><li>concept_checks.hpp </li><li>iterator.hpp </li></ul><p> In base.hpp: </p> <p> On line 84 where it defines array_iterator you should see an additional template parameter for IteratorCategory that is not in the general release. There are other differences as well, but this is a tell-tale sign. </p> <p> In concept_checks.hpp: </p> <p> At line 134 there is an additional line in the MutableMultiArrayConcept struct definition that is not in the general release. This is the only difference. </p> <pre class="wiki"> function_requires&lt; boost::OutputIterator&lt;iterator,value_type&gt; &gt;(); </pre><p> In iterator.hpp: </p> <p> Near the beginning just after the definition of operator_arrow_proxy is a declaration for array_iterator. Just like in base.hpp there is an additional template parameter for IteratorCategory that is not in the general release. </p> <p> Without these updated files simply calling resize will generate the _Copy_impl error. With these files, I do not get the error. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 13 Apr 2012 06:28:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:29 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:29</guid> <description> <p> worked for me, thx </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ronald Garcia</dc:creator> <pubDate>Thu, 17 May 2012 14:52:53 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4874#comment:30 https://svn.boost.org/trac10/ticket/4874#comment:30 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/78496" title="Pushing fixes over from the trunk to the release branch. Fixes #5664 ...">[78496]</a>) Pushing fixes over from the trunk to the release branch. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5664" title="#5664: Bugs: multi_array's operator() checks for Collection concept but requires ... (closed: fixed)">#5664</a> Fixes <a class="reopened ticket" href="https://svn.boost.org/trac10/ticket/4874" title="#4874: Bugs: multi_array compile errors using Visual C++ 2010 in debug mode (reopened)">#4874</a> </p> Ticket Ronald Garcia Thu, 17 May 2012 15:00:41 GMT <link>https://svn.boost.org/trac10/ticket/4874#comment:31 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:31</guid> <description> <p> I updated the release and trunk branches with a fix targeted only to VS 2010. However, the documentation for <a class="missing wiki">MultiArray</a> now notes that a <a class="missing wiki">MultiArray</a> iterator must model output_iterator. However, this does not require an iterator to have output_iterator_tag. The standard is somewhat ambiguous on this point because the iterator categories muddle traversal and reference behavior in unfortunate ways. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>rakesh</dc:creator> <pubDate>Mon, 04 Jun 2012 08:28:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:32 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:32</guid> <description> <p> Hi Garcia, </p> <p> Can we expect the fix with the 1.50 release ? </p> <p> Thanks </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ronald Garcia</dc:creator> <pubDate>Tue, 05 Jun 2012 18:02:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:33 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:33</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4874#comment:32" title="Comment 32">rakesh</a>: </p> <blockquote class="citation"> <p> Hi Garcia, </p> <p> Can we expect the fix with the 1.50 release ? </p> <p> Thanks </p> </blockquote> <p> Hi Rakesh, </p> <p> The answer is a definite Yes! Thanks to everyone for their contributions to this ticket, which ultimately led to the fix. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Bill Buklis</dc:creator> <pubDate>Tue, 05 Jun 2012 19:20:17 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:34 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:34</guid> <description> <p> That's excellent news. </p> <p> Any possibility of also getting <a class="new ticket" href="https://svn.boost.org/trac10/ticket/6554" title="#6554: Bugs: Compiler error dereferencing multi_array value via an iterator (new)">ticket:6554</a> into 1.50? I attached a proposed fix for this one. </p> <p> I noticed that <a class="new ticket" href="https://svn.boost.org/trac10/ticket/6811" title="#6811: Bugs: Default argument of type multi_array fails under MSVC 2010 SP1 (new)">ticket:6811</a> has a proposed fix as well. I haven't personally come across this issue, but it's still interesting. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Tue, 05 Jun 2012 22:56:41 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:35 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:35</guid> <description> <p> Hello Bill, </p> <p> This is probably not the appropriate place to talk about other tickets, but the answer is no: 1.50 is currently in Beta, so only show-stopper fixes are going to be incorporated. </p> </description> <category>Ticket</category> </item> <item> <author>a.elovikov@…</author> <pubDate>Thu, 06 Sep 2012 10:28:27 GMT</pubDate> <title>status changed; resolution deleted https://svn.boost.org/trac10/ticket/4874#comment:36 https://svn.boost.org/trac10/ticket/4874#comment:36 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> Hi all. I see the same error when using Intel Compiler because it uses the same headers as MSVC does. </p> <pre class="wiki">$ icl.exe /nologo -Fo"libs/multi_array/test/../../../bin.v2/libs/multi_array/test/assert.test/intel-win/debug/threading-multi/assert.obj" -TP /Z7 /Od /Ob0 /W3 /GR /MDd /Zc:forScope /Zc:wchar_t /Qwn5 /Qwd985 -Qoption,c,--arg_dep_lookup -D_SECURE_SCL=0 -Qoption,cpp,--arg_dep_lookup -Qpchi- /wd4675 /EHs -c -DBOOST_ALL_NO_LIB=1 -DBOOST_TEST_NO_AUTO_LINK=1 "-Ilibs/multi_array/test/../../.." "libs/multi_array/test/assert.cpp" assert.cpp libs/multi_array/test/../../../boost/test/utils/basic_cstring/basic_cstring.hpp(60): warning #66: enumeration value is out of "int" range enum npos_type { npos = static_cast&lt;size_type&gt;(-1) }; ^ c:/Program files (x86)/Microsoft Visual Studio 10.0/VC/include/xutility(2215): error: no instance of overloaded function "std::_Copy_impl" matches the argument list argument types are: (boost::detail::multi_array::array_iterator&lt;int, const int *, boost::mpl::size_t&lt;2Ui64&gt;, boost::detail::multi_array::const_sub_array&lt;int, 1Ui64, const int *&gt;, boost::random_access_traversal_tag&gt;, boost::detail::multi_array::array_iterator&lt;int, const int *, boost::mpl::size_t&lt;2Ui64&gt;, boost::detail::multi_array::const_sub_array&lt;int, 1Ui64, const int *&gt;, boost::random_access_traversal_tag&gt;, boost::detail::multi_array::array_iterator&lt;int, int *, boost::mpl::size_t&lt;2Ui64&gt;, boost::detail::multi_array::sub_array&lt;int, 1Ui64&gt;, boost::random_access_traversal_tag&gt;, boost::detail::iterator_category_with_traversal&lt;std::input_iterator_tag, boost::random_access_traversal_tag&gt;, boost::detail::iterator_category_with_traversal&lt;std::input_iterator_tag, boost::random_access_traversal_tag&gt;) return (_Copy_impl(_First, _Last, ^ detected during: instantiation of "_OutIt std::_Copy_impl(_InIt, _InIt, _OutIt, std::tr1::false_type) [with _InIt=boost::detail::multi_array::array_iterator&lt;int, const int *, boost::mpl::size_t&lt;2Ui64&gt;, boost::detail::multi_array::const_sub_array&lt;int, 1Ui64, const int *&gt;, boost::random_access_traversal_tag&gt;, _OutIt=boost::detail::multi_array::array_iterator&lt;int, int *, boost::mpl::size_t&lt;2Ui64&gt;, boost::detail::multi_array::sub_array&lt;int, 1Ui64&gt;, boost::random_access_traversal_tag&gt;]" at line 2227 instantiation of "_OutIt std::copy(_InIt, _InIt, _OutIt) [with _InIt=boost::detail::multi_array::array_iterator&lt;int, const int *, boost::mpl::size_t&lt;2Ui64&gt;, boost::detail::multi_array::const_sub_array&lt;int, 1Ui64, const int *&gt;, boost::random_access_traversal_tag&gt;, _OutIt=boost::detail::multi_array::array_iterator&lt;int, int *, boost::mpl::size_t&lt;2Ui64&gt;, boost::detail::multi_array::sub_array&lt;int, 1Ui64&gt;, boost::random_access_traversal_tag&gt;]" at line 490 of "libs/multi_array/test/../../../boost/multi_array/multi_array_ref.hpp" instantiation of "boost::multi_array_ref&lt;T, NumDims&gt; &amp;boost::multi_array_ref&lt;T, NumDims&gt;::operator=(const ConstMultiArray &amp;) [with T=int, NumDims=2Ui64, ConstMultiArray=boost::multi_array&lt;int, 2Ui64, std::allocator&lt;int&gt;&gt;]" at line 377 of "libs/multi_array/test/../../../boost/multi_array.hpp" instantiation of "boost::multi_array&lt;T, NumDims, Allocator&gt; &amp;boost::multi_array&lt;T, NumDims, Allocator&gt;::operator=(const boost::multi_array&lt;T, NumDims, Allocator&gt; &amp;) [with T=int, NumDims=2Ui64, Allocator=std::allocator&lt;int&gt;]" at line 52 of "libs/multi_array/test/assert.cpp" compilation aborted for libs/multi_array/test/assert.cpp (code 2) </pre><p> But BOOST_MSVC is defined only in boost/config/compiler/visualc.hpp and left undefined in case of icl: </p> <pre class="wiki">$ icl.exe /nologo -Fo"libs/multi_array/test/../../../bin.v2/libs/multi_array/test/assert.test/intel-win/debug/threading-multi/assert.obj" -TP /Z7 /Od /Ob0 /W3 /GR /MDd /Zc:forScope /Zc:wchar_t /Qwn5 /Qwd985 -Qoption,c,--arg_dep_lookup -D_SECURE_SCL=0 -Qoption,cpp,--arg_dep_lookup -Qpchi- /wd4675 /EHs -c -DBOOST_ALL_NO_LIB=1 -DBOOST_TEST_NO_AUTO_LINK=1 "-Ilibs/multi_array/test/../../.." "libs/multi_array/test/assert.cpp" -E -QdD | grep -e "BOOST_MSVC" assert.cpp #define BOOST_MSVC6_MEMBER_TEMPLATES #define BOOST_MSVC_WORKAROUND_GUARD 1 #define BOOST_MSVC_FULL_VER_WORKAROUND_GUARD 1 #define BOOST_MSVC_TYPENAME typename #define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait,name,default_) template&lt; typename T, typename fallback_ = boost::mpl::bool_&lt;default_&gt; &gt; struct trait { struct gcc_3_2_wknd { template&lt; typename U &gt; static boost::mpl::aux::yes_tag test( boost::mpl::aux::type_wrapper&lt;U&gt; const volatile* , boost::mpl::aux::type_wrapper&lt;BOOST_MSVC_TYPENAME U::name&gt;* = 0 ); static boost::mpl::aux::no_tag test(...); }; typedef boost::mpl::aux::type_wrapper&lt;T&gt; t_; BOOST_STATIC_CONSTANT(bool, value = sizeof(gcc_3_2_wknd::test(static_cast&lt;t_*&gt;(0))) == sizeof(boost::mpl::aux::yes_tag) ); typedef boost::mpl::bool_&lt;value&gt; type; }; </pre><p> I suppose that the correct define to check is _MSC_VER which is defined when using Intel Compiler. The following seems to fix it for me: </p> <pre class="wiki">$ diff -Naur boost/multi_array/base.hpp{.orig,} --- boost/multi_array/base.hpp.orig 2012-09-06 17:18:17.497270700 +0700 +++ boost/multi_array/base.hpp 2012-09-06 17:21:22.735770700 +0700 @@ -256,7 +256,7 @@ // MSVC 2010 is broken in debug mode: it requires // that an Output Iterator have output_iterator_tag in its iterator_category if // that iterator is not bidirectional_iterator or random_access_iterator. -#if BOOST_WORKAROUND(BOOST_MSVC, &gt;= 1600) +#if BOOST_WORKAROUND(_MSC_VER, &gt;= 1600) struct mutable_iterator_tag : boost::random_access_traversal_tag, std::input_iterator_tag { @@ -314,7 +314,7 @@ // // iterator support // -#if BOOST_WORKAROUND(BOOST_MSVC, &gt;= 1600) +#if BOOST_WORKAROUND(_MSC_VER, &gt;= 1600) // Deal with VC 2010 output_iterator_tag requirement typedef array_iterator&lt;T,T*,mpl::size_t&lt;NumDims&gt;,reference, mutable_iterator_tag&gt; iterator; </pre> Ticket herohuyongtao@… Mon, 28 Jan 2013 07:07:46 GMT <link>https://svn.boost.org/trac10/ticket/4874#comment:37 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:37</guid> <description> <p> But this problem still exists in VS2012 Debug x64 mode even with these updates. Please help to fix. Thanks. </p> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/4874#comment:28" title="Comment 28">bill_buklis</a>: </p> <blockquote class="citation"> <p> First let's make sure that you have the right version of the multi_array headers (located in the boost/multi_array folder). There are only three files that are different from the regular release: </p> <ul><li>base.hpp </li><li>concept_checks.hpp </li><li>iterator.hpp </li></ul><p> In base.hpp: </p> <p> On line 84 where it defines array_iterator you should see an additional template parameter for IteratorCategory that is not in the general release. There are other differences as well, but this is a tell-tale sign. </p> <p> In concept_checks.hpp: </p> <p> At line 134 there is an additional line in the MutableMultiArrayConcept struct definition that is not in the general release. This is the only difference. </p> <pre class="wiki"> function_requires&lt; boost::OutputIterator&lt;iterator,value_type&gt; &gt;(); </pre><p> In iterator.hpp: </p> <p> Near the beginning just after the definition of operator_arrow_proxy is a declaration for array_iterator. Just like in base.hpp there is an additional template parameter for IteratorCategory that is not in the general release. </p> <p> Without these updated files simply calling resize will generate the _Copy_impl error. With these files, I do not get the error. </p> </blockquote> </description> <category>Ticket</category> </item> <item> <author>nilsgladitz@…</author> <pubDate>Thu, 13 Nov 2014 11:33:14 GMT</pubDate> <title>cc changed https://svn.boost.org/trac10/ticket/4874#comment:38 https://svn.boost.org/trac10/ticket/4874#comment:38 <ul> <li><strong>cc</strong> <span class="trac-author">nilsgladitz@…</span> added </li> </ul> Ticket anonymous Tue, 02 Dec 2014 11:27:24 GMT <link>https://svn.boost.org/trac10/ticket/4874#comment:39 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:39</guid> <description> <p> My fix for Intel compiler (x64 debug mode) - to pick up the workaround in the BOOST implementation: </p> <p> #define BOOST_MSVC _MSC_VER </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 28 Oct 2015 11:11:37 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:40 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:40</guid> <description> <p> I'm getting this same issue on MSVC12 with boost 1.58 on 64 Bit debug. It's causing a bit of a headache. Is this bug still being looked into? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Wed, 28 Oct 2015 11:14:36 GMT</pubDate> <title>keywords, version changed https://svn.boost.org/trac10/ticket/4874#comment:41 https://svn.boost.org/trac10/ticket/4874#comment:41 <ul> <li><strong>keywords</strong> 2013 added </li> <li><strong>version</strong> <span class="trac-field-old">Boost 1.47.0</span> → <span class="trac-field-new">Boost 1.58.0</span> </li> </ul> Ticket ikku100 Thu, 11 Aug 2016 10:00:10 GMT <link>https://svn.boost.org/trac10/ticket/4874#comment:42 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:42</guid> <description> <p> This problem still exists for Intel compiler 16, boost 1.60, in Debug mode for visual studio, both for 32 and 64 bit. </p> </description> <category>Ticket</category> </item> <item> <author>kristian.bjerre.schmidt@…</author> <pubDate>Tue, 15 Aug 2017 12:59:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4874#comment:43 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4874#comment:43</guid> <description> <p> I ran into this upgrading an old codebase to use Boost 1.64 and compile on windows in addition to linux. </p> <p> DISCLAIMER: I don't know what I'm doing. I'm quite new to c++, and I just fiddled around until something worked. </p> <p> Based on the answer from istanbul.tr, I made the following modifications: In multi_array/iterator.hpp line 69, I replaced boost::random_access_traversal_tag with std::random_access_iterator_tag </p> <p> In multi_array/base.hpp line 227, I added std::random_access_iterator_tag to the base classes of mutable_iterator_tag. This gives me a bunch of warnings that say that mutable_iterator_tag's base class std::input_iterator_tag is already a base class of std::random_access_iterator_tag. But now it works! </p> <p> Like I mentioned, I have no idea what I'm doing or why this exact configuration works. Any comments are appreciated, and hopefully this gives someone smarter than me a hint as to what needs to be done to fix this. </p> </description> <category>Ticket</category> </item> </channel> </rss>