Boost C++ Libraries: Ticket #12895: VS 2012: zip_iterator dereference causes a compiler error https://svn.boost.org/trac10/ticket/12895 <p> Using Visual Studio 2012 (vc110), any direct or indirect usage of the dereference operation of zip_iterator produces now a compiler error, a simple reproducer is the following example: </p> <pre class="wiki">#include "boost/iterator/zip_iterator.hpp" int main() { typedef boost::tuple&lt;char*, char*&gt; iterators_t; char chars[] = "abc"; iterators_t iters(chars + 0, chars + 3); boost::iterators::zip_iterator&lt;iterators_t&gt; zip(iters); *zip; } </pre><p> which results in the following compiler output: </p> <pre class="wiki">1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(364): error C2825: '_Iter': must be a class or namespace when followed by '::' 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\iterator\iterator_traits.hpp(28) : see reference to class template instantiation 'std::iterator_traits&lt;_Iter&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; _Iter=char *const 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\iterator\zip_iterator.hpp(90) : see reference to class template instantiation 'boost::iterators::iterator_reference&lt;Iterator&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Iterator=char *const 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\utility\result_of.hpp(190) : see reference to class template instantiation 'boost::iterators::detail::dereference_iterator::result&lt;&lt;unnamed-symbol&gt;&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; &lt;unnamed-symbol&gt;=boost::iterators::detail::dereference_iterator (char *const &amp;) 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\utility\result_of.hpp(197) : see reference to class template instantiation 'boost::detail::result_of_nested_result&lt;F,FArgs&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; F=boost::iterators::detail::dereference_iterator, 1&gt; FArgs=boost::iterators::detail::dereference_iterator (char *const &amp;) 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\utility\detail\result_of_iterate.hpp(37) : see reference to class template instantiation 'boost::detail::tr1_result_of_impl&lt;F,FArgs,HasResultType&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; F=boost::iterators::detail::dereference_iterator, 1&gt; FArgs=boost::iterators::detail::dereference_iterator (char *const &amp;), 1&gt; HasResultType=false 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\utility\detail\result_of_iterate.hpp(160) : see reference to class template instantiation 'boost::tr1_result_of&lt;F&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; F=boost::iterators::detail::dereference_iterator (char *const &amp;) 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\fusion\view\transform_view\detail\apply_transform_result.hpp(31) : see reference to class template instantiation 'boost::result_of&lt;F&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; F=boost::iterators::detail::dereference_iterator (char *const &amp;) 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\mpl\aux_\preprocessed\plain\apply_wrap.hpp(39) : see reference to class template instantiation 'boost::fusion::detail::apply_transform_result&lt;F&gt;::apply&lt;T0&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; F=boost::iterators::detail::dereference_iterator, 1&gt; T0=char *const &amp; 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\mpl\aux_\preprocessed\plain\apply.hpp(43) : see reference to class template instantiation 'boost::mpl::apply_wrap1&lt;F,T1&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; F=boost::fusion::detail::apply_transform_result&lt;boost::iterators::detail::dereference_iterator&gt;, 1&gt; T1=char *const &amp; 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\mpl\aux_\preprocessed\plain\apply.hpp(51) : see reference to class template instantiation 'boost::mpl::apply1&lt;F,T1&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; F=boost::fusion::detail::apply_transform_result&lt;boost::iterators::detail::dereference_iterator&gt;, 1&gt; T1=char *const &amp; 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\fusion\view\transform_view\detail\deref_impl.hpp(38) : see reference to class template instantiation 'boost::mpl::apply&lt;F,T1&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; F=boost::fusion::detail::apply_transform_result&lt;boost::iterators::detail::dereference_iterator&gt;, 1&gt; T1=char *const &amp; 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\fusion\iterator\deref.hpp(54) : see reference to class template instantiation 'boost::fusion::extension::deref_impl&lt;boost::fusion::transform_view_iterator_tag&gt;::apply&lt;Iterator&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Iterator=boost::fusion::transform_view_iterator&lt;boost::fusion::boost_tuple_iterator&lt;const iterators_t&gt;,boost::iterators::detail::dereference_iterator&gt; 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\fusion\adapted\boost_tuple\detail\build_cons.hpp(53) : see reference to class template instantiation 'boost::fusion::result_of::deref&lt;Iterator&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Iterator=boost::fusion::transform_view_iterator&lt;boost::fusion::boost_tuple_iterator&lt;const iterators_t&gt;,boost::iterators::detail::dereference_iterator&gt; 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\fusion\adapted\boost_tuple\detail\build_cons.hpp(52) : while compiling class template member function 'boost::tuples::cons&lt;HT,TT&gt; boost::fusion::detail::build_tuple_cons&lt;First,Last&gt;::call(const First &amp;,const Last &amp;)' 1&gt; with 1&gt; [ 1&gt; HT=char &amp;, 1&gt; TT=boost::tuples::cons&lt;char &amp;,boost::fusion::detail::build_tuple_cons&lt;boost::fusion::single_view_iterator&lt;const boost::fusion::single_view&lt;char &amp;&gt;,boost::mpl::int_&lt;1&gt;&gt;,boost::fusion::single_view_iterator&lt;const boost::fusion::single_view&lt;char &amp;&gt;,boost::mpl::int_&lt;1&gt;&gt;&gt;::type&gt;, 1&gt; First=boost::fusion::transform_view_iterator&lt;boost::fusion::boost_tuple_iterator&lt;const iterators_t&gt;,boost::iterators::detail::dereference_iterator&gt;, 1&gt; Last=boost::fusion::transform_view_iterator&lt;boost::fusion::boost_tuple_iterator&lt;const boost::tuples::null_type&gt;,boost::iterators::detail::dereference_iterator&gt; 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\fusion\adapted\boost_tuple\detail\convert_impl.hpp(43) : see reference to function template instantiation 'boost::tuples::cons&lt;HT,TT&gt; boost::fusion::detail::build_tuple_cons&lt;First,Last&gt;::call(const First &amp;,const Last &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; HT=char &amp;, 1&gt; TT=boost::tuples::cons&lt;char &amp;,boost::fusion::detail::build_tuple_cons&lt;boost::fusion::single_view_iterator&lt;const boost::fusion::single_view&lt;char &amp;&gt;,boost::mpl::int_&lt;1&gt;&gt;,boost::fusion::single_view_iterator&lt;const boost::fusion::single_view&lt;char &amp;&gt;,boost::mpl::int_&lt;1&gt;&gt;&gt;::type&gt;, 1&gt; First=boost::fusion::transform_view_iterator&lt;boost::fusion::boost_tuple_iterator&lt;const iterators_t&gt;,boost::iterators::detail::dereference_iterator&gt;, 1&gt; Last=boost::fusion::transform_view_iterator&lt;boost::fusion::boost_tuple_iterator&lt;const boost::tuples::null_type&gt;,boost::iterators::detail::dereference_iterator&gt; 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\fusion\adapted\boost_tuple\detail\convert_impl.hpp(37) : see reference to class template instantiation 'boost::fusion::detail::build_tuple_cons&lt;First,Last&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; First=boost::fusion::transform_view_iterator&lt;boost::fusion::boost_tuple_iterator&lt;const iterators_t&gt;,boost::iterators::detail::dereference_iterator&gt;, 1&gt; Last=boost::fusion::transform_view_iterator&lt;boost::fusion::boost_tuple_iterator&lt;const boost::tuples::null_type&gt;,boost::iterators::detail::dereference_iterator&gt; 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\fusion\sequence\convert.hpp(37) : see reference to class template instantiation 'boost::fusion::extension::convert_impl&lt;boost::fusion::boost_tuple_tag&gt;::apply&lt;Sequence&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Sequence=const boost::fusion::transform_view&lt;const iterators_t,boost::iterators::detail::dereference_iterator&gt; 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\iterator\zip_iterator.hpp(214) : see reference to class template instantiation 'boost::fusion::result_of::convert&lt;Tag,Sequence&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Tag=tag, 1&gt; Sequence=const boost::fusion::transform_view&lt;const iterators_t,boost::iterators::detail::dereference_iterator&gt; 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\iterator\zip_iterator.hpp(289) : see reference to function template instantiation 'reference boost::iterators::detail::converter&lt;reference&gt;::call&lt;boost::fusion::transform_view&lt;Sequence1,Sequence2&gt;&gt;(Seq)' being compiled 1&gt; with 1&gt; [ 1&gt; reference=reference, 1&gt; Sequence1=const iterators_t, 1&gt; Sequence2=boost::iterators::detail::dereference_iterator, 1&gt; Seq=boost::fusion::transform_view&lt;const iterators_t,boost::iterators::detail::dereference_iterator&gt; 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\iterator\zip_iterator.hpp(289) : see reference to function template instantiation 'reference boost::iterators::detail::converter&lt;reference&gt;::call&lt;boost::fusion::transform_view&lt;Sequence1,Sequence2&gt;&gt;(Seq)' being compiled 1&gt; with 1&gt; [ 1&gt; reference=reference, 1&gt; Sequence1=const iterators_t, 1&gt; Sequence2=boost::iterators::detail::dereference_iterator, 1&gt; Seq=boost::fusion::transform_view&lt;const iterators_t,boost::iterators::detail::dereference_iterator&gt; 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\iterator\zip_iterator.hpp(284) : while compiling class template member function 'boost::tuples::cons&lt;HT,TT&gt; boost::iterators::zip_iterator&lt;IteratorTuple&gt;::dereference(void) const' 1&gt; with 1&gt; [ 1&gt; HT=char &amp;, 1&gt; TT=boost::tuples::cons&lt;char &amp;,boost::fusion::detail::build_tuple_cons&lt;boost::fusion::single_view_iterator&lt;const boost::fusion::single_view&lt;char &amp;&gt;,boost::mpl::int_&lt;1&gt;&gt;,boost::fusion::single_view_iterator&lt;const boost::fusion::single_view&lt;char &amp;&gt;,boost::mpl::int_&lt;1&gt;&gt;&gt;::type&gt;, 1&gt; IteratorTuple=iterators_t 1&gt; ] 1&gt; c:\projects\thirdparty\boost_1_63_0\boost\iterator\iterator_facade.hpp(549) : see reference to function template instantiation 'boost::tuples::cons&lt;HT,TT&gt; boost::iterators::zip_iterator&lt;IteratorTuple&gt;::dereference(void) const' being compiled 1&gt; with 1&gt; [ 1&gt; HT=char &amp;, 1&gt; TT=boost::tuples::cons&lt;char &amp;,boost::fusion::detail::build_tuple_cons&lt;boost::fusion::single_view_iterator&lt;const boost::fusion::single_view&lt;char &amp;&gt;,boost::mpl::int_&lt;1&gt;&gt;,boost::fusion::single_view_iterator&lt;const boost::fusion::single_view&lt;char &amp;&gt;,boost::mpl::int_&lt;1&gt;&gt;&gt;::type&gt;, 1&gt; IteratorTuple=iterators_t 1&gt; ] 1&gt; h:\develop\cpp\c++0x\vssandbox - 2011\main.cpp(8) : see reference to class template instantiation 'boost::iterators::zip_iterator&lt;IteratorTuple&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; IteratorTuple=iterators_t 1&gt; ] 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(364): error C2039: 'iterator_category' : is not a member of '`global namespace'' 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(364): error C2146: syntax error : missing ';' before identifier 'iterator_category' 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(364): error C2602: 'std::iterator_traits&lt;_Iter&gt;::iterator_category' is not a member of a base class of 'std::iterator_traits&lt;_Iter&gt;' 1&gt; with 1&gt; [ 1&gt; _Iter=char *const 1&gt; ] 1&gt; c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(364) : see declaration of 'std::iterator_traits&lt;_Iter&gt;::iterator_category' 1&gt; with 1&gt; [ 1&gt; _Iter=char *const 1&gt; ] 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(364): error C2868: 'std::iterator_traits&lt;_Iter&gt;::iterator_category' : illegal syntax for using-declaration; expected qualified-name 1&gt; with 1&gt; [ 1&gt; _Iter=char *const 1&gt; ] 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(365): error C2825: '_Iter': must be a class or namespace when followed by '::' 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(365): error C2039: 'value_type' : is not a member of '`global namespace'' 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(365): error C2146: syntax error : missing ';' before identifier 'value_type' 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(365): error C2602: 'std::iterator_traits&lt;_Iter&gt;::value_type' is not a member of a base class of 'std::iterator_traits&lt;_Iter&gt;' 1&gt; with 1&gt; [ 1&gt; _Iter=char *const 1&gt; ] 1&gt; c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(365) : see declaration of 'std::iterator_traits&lt;_Iter&gt;::value_type' 1&gt; with 1&gt; [ 1&gt; _Iter=char *const 1&gt; ] 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(365): error C2868: 'std::iterator_traits&lt;_Iter&gt;::value_type' : illegal syntax for using-declaration; expected qualified-name 1&gt; with 1&gt; [ 1&gt; _Iter=char *const 1&gt; ] 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(366): error C2825: '_Iter': must be a class or namespace when followed by '::' 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(366): error C2039: 'difference_type' : is not a member of '`global namespace'' 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(366): error C2146: syntax error : missing ';' before identifier 'difference_type' 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(366): error C2602: 'std::iterator_traits&lt;_Iter&gt;::difference_type' is not a member of a base class of 'std::iterator_traits&lt;_Iter&gt;' 1&gt; with 1&gt; [ 1&gt; _Iter=char *const 1&gt; ] 1&gt; c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(366) : see declaration of 'std::iterator_traits&lt;_Iter&gt;::difference_type' 1&gt; with 1&gt; [ 1&gt; _Iter=char *const 1&gt; ] 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(366): error C2868: 'std::iterator_traits&lt;_Iter&gt;::difference_type' : illegal syntax for using-declaration; expected qualified-name 1&gt; with 1&gt; [ 1&gt; _Iter=char *const 1&gt; ] 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(368): error C2825: '_Iter': must be a class or namespace when followed by '::' 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(368): error C2039: 'pointer' : is not a member of '`global namespace'' 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(368): error C2146: syntax error : missing ';' before identifier 'pointer' 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(368): error C2602: 'std::iterator_traits&lt;_Iter&gt;::pointer' is not a member of a base class of 'std::iterator_traits&lt;_Iter&gt;' 1&gt; with 1&gt; [ 1&gt; _Iter=char *const 1&gt; ] 1&gt; c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(368) : see declaration of 'std::iterator_traits&lt;_Iter&gt;::pointer' 1&gt; with 1&gt; [ 1&gt; _Iter=char *const 1&gt; ] 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(368): error C2868: 'std::iterator_traits&lt;_Iter&gt;::pointer' : illegal syntax for using-declaration; expected qualified-name 1&gt; with 1&gt; [ 1&gt; _Iter=char *const 1&gt; ] 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(369): error C2825: '_Iter': must be a class or namespace when followed by '::' 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(369): error C2039: 'reference' : is not a member of '`global namespace'' 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(369): error C2146: syntax error : missing ';' before identifier 'reference' 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(369): error C2602: 'std::iterator_traits&lt;_Iter&gt;::reference' is not a member of a base class of 'std::iterator_traits&lt;_Iter&gt;' 1&gt; with 1&gt; [ 1&gt; _Iter=char *const 1&gt; ] 1&gt; c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(369) : see declaration of 'std::iterator_traits&lt;_Iter&gt;::reference' 1&gt; with 1&gt; [ 1&gt; _Iter=char *const 1&gt; ] 1&gt;c:\program files (x86)\microsoft visual studio 11.0\vc\include\xutility(369): error C2868: 'std::iterator_traits&lt;_Iter&gt;::reference' : illegal syntax for using-declaration; expected qualified-name 1&gt; with 1&gt; [ 1&gt; _Iter=char *const 1&gt; ] 1&gt;c:\projects\thirdparty\boost_1_63_0\boost\fusion\adapted\boost_tuple\detail\build_cons.hpp(53): error C2440: 'initializing' : cannot convert from 'char *const ' to 'char &amp;' ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ========== </pre><p> The problem seems rather severe to me and may occur even though the user-code didn't actually use zip_iterator directly. In fact I became aware of the problem when a colleague asked me why the following code would no longer be accepted when we switched from Boost 1.57 to Boost 1.63: </p> <pre class="wiki">#include "boost/range/combine.hpp" int main() { int a[] = { 1, 2, 3 }; int b[] = { 4, 5, 6 }; for(const auto&amp; p : boost::combine(a, b)) { } } </pre><p> According to my not fully completed analysis, the problem is caused, because the current implementation of zip_iterator::dereference relies on a recently introduced feature of std::iterator_traits being now sfinae-friendly (See LWG issue 2408), which is not the case in the VS 2012 Standard Library. This assumption gets support by the fact that both VS 2015 and VS 2017 accept the code (And both compiler's Standard Libraries provide sfinae-friendly iterator_traits). </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12895 Trac 1.4.3 anonymous Fri, 10 Mar 2017 22:21:53 GMT <link>https://svn.boost.org/trac10/ticket/12895#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12895#comment:1</guid> <description> <p> Bisection among published Boost version shows that the first appearance of that problem occurred in Boost 1.60. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Michel Morin</dc:creator> <pubDate>Sat, 11 Mar 2017 04:22:57 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12895#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12895#comment:2</guid> <description> <blockquote class="citation"> <p> the first appearance of that problem occurred in Boost 1.60. </p> </blockquote> <p> Maybe <a class="ext-link" href="https://github.com/boostorg/iterator/pull/2"><span class="icon">​</span>this PR</a> is related. </p> </description> <category>Ticket</category> </item> <item> <author>daniel.kruegler@…</author> <pubDate>Tue, 14 Mar 2017 06:54:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12895#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12895#comment:3</guid> <description> <p> The problem seems to be that <code>boost::iterators::detail::dereference_iterator</code>'s member template <code>result</code> gets as argument <code>Iterator</code> the effective type <code>char* const &amp;</code>, therefore the operation sequence </p> <pre class="wiki">typedef typename remove_reference&lt;typename remove_cv&lt;Iterator&gt;::type&gt;::type iterator; </pre><p> doesn't do enough, it just reduces <code>Iterator</code> to <code>char* const</code>, therefore <code>std::iterator_traits&lt;char* const&gt;</code> instantiates the primary template instead of the partial specialization for pointers. </p> <p> Either one should prevent that a reference type is passed to this member template or the reduction code should be extended by adding an <em>initial</em> reference removal: </p> <pre class="wiki">typedef typename remove_reference&lt;typename remove_cv&lt;typename remove_reference&lt;Iterator&gt;::type&gt;::type&gt;::type iterator; </pre> </description> <category>Ticket</category> </item> <item> <author>daniel.kruegler@…</author> <pubDate>Tue, 14 Mar 2017 07:03:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12895#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12895#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/12895#comment:3" title="Comment 3">daniel.kruegler@…</a>: </p> <blockquote class="citation"> <p> Either one should prevent that a reference type is passed to this member template or the reduction code should be extended by adding an <em>initial</em> reference removal: </p> <pre class="wiki">typedef typename remove_reference&lt;typename remove_cv&lt;typename remove_reference&lt;Iterator&gt;::type&gt;::type&gt;::type iterator; </pre></blockquote> <p> In fact the application of remove_reference and remove_cv is applied in the wrong order, it would suffice to invert them as follows: </p> <pre class="wiki">typedef typename remove_cv&lt;typename remove_reference&lt;Iterator&gt;::type&gt;::type iterator; </pre> </description> <category>Ticket</category> </item> <item> <author>daniel.kruegler@…</author> <pubDate>Tue, 14 Mar 2017 09:05:17 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12895#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12895#comment:5</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/12895#comment:4" title="Comment 4">daniel.kruegler@…</a>: </p> <blockquote class="citation"> <p> In fact the application of remove_reference and remove_cv is applied in the wrong order, it would suffice to invert them as follows: </p> <pre class="wiki">typedef typename remove_cv&lt;typename remove_reference&lt;Iterator&gt;::type&gt;::type iterator; </pre></blockquote> <p> I applied that simple fix locally and it was sufficient to resolve that problem. What is the preferred way to make a concrete patch suggestion? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Michel Morin</dc:creator> <pubDate>Tue, 14 Mar 2017 13:57:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12895#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12895#comment:6</guid> <description> <p> Hi Daniel, </p> <p> I failed to reproduce the error on gcc 6. Oh, I forgot that the default mode of gcc 6 is C++ 14, which means the decltype-based <code>boost::result_of</code> is used (by default). </p> <p> If I explicitly specify <code>-std=c++03</code> or define <code>BOOST_RESULT_OF_USE_TR1</code>, I can reproduce the error. I've also confirmed that the proposed fix resolves the compilation error. </p> <blockquote class="citation"> <p> What is the preferred way to make a concrete patch suggestion? </p> </blockquote> <p> I think the best approach is to submit a pull request to <a class="ext-link" href="https://github.com/boostorg/iterator"><span class="icon">​</span>https://github.com/boostorg/iterator</a> . Thanks for the report and the fix! </p> </description> <category>Ticket</category> </item> <item> <author>daniel.kruegler@…</author> <pubDate>Tue, 14 Mar 2017 19:54:24 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12895#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12895#comment:7</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/12895#comment:6" title="Comment 6">michel</a>: </p> <blockquote class="citation"> <p> Hi Daniel, </p> <p> I failed to reproduce the error on gcc 6. Oh, I forgot that the default mode of gcc 6 is C++ 14, which means the decltype-based <code>boost::result_of</code> is used (by default). </p> <p> If I explicitly specify <code>-std=c++03</code> or define <code>BOOST_RESULT_OF_USE_TR1</code>, I can reproduce the error. I've also confirmed that the proposed fix resolves the compilation error. </p> </blockquote> <p> Thanks for your independent evaluation and verification! </p> <blockquote class="citation"> <blockquote class="citation"> <p> What is the preferred way to make a concrete patch suggestion? </p> </blockquote> <p> I think the best approach is to submit a pull request to <a class="ext-link" href="https://github.com/boostorg/iterator"><span class="icon">​</span>https://github.com/boostorg/iterator</a> . Thanks for the report and the fix! </p> </blockquote> <p> A pull request is available now: </p> <p> <a class="ext-link" href="https://github.com/boostorg/iterator/pull/22"><span class="icon">​</span>https://github.com/boostorg/iterator/pull/22</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Michel Morin</dc:creator> <pubDate>Wed, 15 Mar 2017 12:12:09 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12895#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12895#comment:8</guid> <description> <blockquote class="citation"> <p> A pull request is available now: </p> </blockquote> <p> Great, thanks for submitting a PR. (<a class="ext-link" href="https://github.com/boostorg/iterator/pull/23"><span class="icon">​</span>PR 23</a> is a followup for it to add a testcase.) </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Edward Diener</dc:creator> <pubDate>Thu, 30 Mar 2017 12:54:25 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/12895#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12895#comment:9</guid> <description> <p> I have applied the PR and the testcase PR in the latest 'develop' branch of iterator. </p> </description> <category>Ticket</category> </item> </channel> </rss>