<div class="gmail_quote">On Tue, Apr 17, 2012 at 8:04 AM, Jens Auer <span dir="ltr">&lt;<a href="mailto:jensa@miltenyibiotec.de">jensa@miltenyibiotec.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks for all the suggestions, they are highly welcome. The output of the MS compiler with the error message is:<br>
1&gt;d:\programme\microsoft visual studio 10.0\vc\include\xutility(728): error C2665: &#39;std::_Debug_range2&#39; : none of the 2 overloads could convert all the argument types<br>
1&gt;          d:\programme\microsoft visual studio 10.0\vc\include\xutility(703): could be &#39;void std::_Debug_range2&lt;_InIt&gt;(_InIt,_InIt,std::_Dbfile_t,std::_Dbline_t,std::input_iterator_tag)&#39;<br>
1&gt;          with<br>
1&gt;          [<br>
1&gt;              _InIt=Iterator::Enumerator&lt;std::_Vector_iterator&lt;std::_Vector_val&lt;int,std::allocator&lt;int&gt;&gt;&gt;,int&gt;<br>
1&gt;          ]<br>
1&gt;          d:\programme\microsoft visual studio 10.0\vc\include\xutility(711): or       &#39;void std::_Debug_range2&lt;_InIt&gt;(_RanIt,_RanIt,std::_Dbfile_t,std::_Dbline_t,std::random_access_iterator_tag)&#39;<br>
1&gt;          with<br>
1&gt;          [<br>
1&gt;              _InIt=Iterator::Enumerator&lt;std::_Vector_iterator&lt;std::_Vector_val&lt;int,std::allocator&lt;int&gt;&gt;&gt;,int&gt;,<br>
1&gt;              _RanIt=Iterator::Enumerator&lt;std::_Vector_iterator&lt;std::_Vector_val&lt;int,std::allocator&lt;int&gt;&gt;&gt;,int&gt;<br>
1&gt;          ]<br>
1&gt;          while trying to match the argument list &#39;(Iterator::Enumerator&lt;Iterator,T&gt;, Iterator::Enumerator&lt;Iterator,T&gt;, std::_Dbfile_t, std::_Dbline_t, boost::random_access_traversal_tag)&#39;<br>
1&gt;          with<br>
1&gt;          [<br>
1&gt;              Iterator=std::_Vector_iterator&lt;std::_Vector_val&lt;int,std::allocator&lt;int&gt;&gt;&gt;,<br>
1&gt;              T=int<br>
1&gt;          ]<br>
1&gt;          d:\programme\microsoft visual studio 10.0\vc\include\algorithm(30) : see reference to function template instantiation &#39;void std::_Debug_range&lt;_InIt&gt;(_InIt,_InIt,std::_Dbfile_t,std::_Dbline_t)&#39; being compiled<br>

1&gt;          with<br>
1&gt;          [<br>
1&gt;              _InIt=Iterator::Enumerator&lt;std::_Vector_iterator&lt;std::_Vector_val&lt;int,std::allocator&lt;int&gt;&gt;&gt;,int&gt;<br>
1&gt;          ]<br>
1&gt;          c:\software development\svn\swdev\cap\mblib\iterator\enumerate.cpp(27) : see reference to function template instantiation &#39;_Fn1 std::for_each&lt;Iterator::Enumerator&lt;Iterator,T&gt;,`anonymous-namespace&#39;::`anonymous-namespace&#39;::&lt;lambda0&gt;&gt;(_InIt,_InIt,_Fn1)&#39; being compiled<br>

1&gt;          with<br>
1&gt;          [<br>
1&gt;              _Fn1=`anonymous-namespace&#39;::`anonymous-namespace&#39;::&lt;lambda0&gt;,<br>
1&gt;              Iterator=std::_Vector_iterator&lt;std::_Vector_val&lt;int,std::allocator&lt;int&gt;&gt;&gt;,<br>
1&gt;              T=int,<br>
1&gt;              _InIt=Iterator::Enumerator&lt;std::_Vector_iterator&lt;std::_Vector_val&lt;int,std::allocator&lt;int&gt;&gt;&gt;,int&gt;<br>
1&gt;          ]<br>
<br>
If anybody is interested I can create a small solution with a project file to reproduce it.<br></blockquote><div><br>Looks like<br><br>boost::random_access_traversal_tag<br><br>doesn&#39;t have a &quot;best conversion&quot; among<br>
<br>std::input_iterator_tag<br>std::random_access_iterator_tag<br><br>My guess is this is where that proxy reference bites you, as it makes your Enumerator iterator not strictly a random access iterator, even though it morally is, so boost::iterator_facade won&#39;t set your iterator_category to std::random_access_iterator_tag and instead tries to go a middle-of-the-road approach (IIRC). Try typedef&#39;ing<br>
<br>typedef std::random_access_iterator_tag iterator_category; // I think this is right...<br><br>in your Enumerator definition and see if MSVC complains?<br><br>- Jeff<br><br></div></div>

