Boost C++ Libraries: Ticket #11558: boost transform iterator doesn't work with libc++ https://svn.boost.org/trac10/ticket/11558 <p> The following code won't compile with clang using these options: </p> <p> clang++ -std=c++14 -stdlib=libc++ main.cpp </p> <p> #include &lt;boost/iterator/counting_iterator.hpp&gt; #include &lt;boost/iterator/transform_iterator.hpp&gt; double f(int i) { return i; } int main() { </p> <blockquote> <p> auto i = boost::make_transform_iterator(boost::make_counting_iterator(3), f); std::next(i); return 0; </p> </blockquote> <p> } </p> <p> It gives me this error: </p> <p> main.cpp:8:3: error: no matching function for call to 'next' </p> <blockquote> <p> std::next(i); <sup><del></del><del></del> </sup></p> </blockquote> <p> /usr/local/bin/../include/c++/v1/iterator:510:25: note: candidate template ignored: disabled by 'enable_if' [with </p> <blockquote> <p> _ForwardIter = boost::iterators::transform_iterator&lt;double (*)(int), boost::iterators::counting_iterator&lt;int, boost::iterators::use_default, boost::iterators::use_default&gt;, boost::iterators::use_default, boost::iterators::use_default&gt;] </p> </blockquote> <blockquote> <p> typename enable_if&lt;<span class="underline">is_forward_iterator&lt;_ForwardIter&gt;::value&gt;::type* = 0) </span></p> <blockquote> <p> <sup> </sup></p> </blockquote> </blockquote> <p> 1 error generated. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11558 Trac 1.4.3 anonymous Thu, 20 Aug 2015 01:10:14 GMT attachment set https://svn.boost.org/trac10/ticket/11558 https://svn.boost.org/trac10/ticket/11558 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">main.cpp</span> </li> </ul> Ticket Michel Morin Thu, 20 Aug 2015 11:21:14 GMT component changed; owner set https://svn.boost.org/trac10/ticket/11558#comment:1 https://svn.boost.org/trac10/ticket/11558#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">jeffrey.hellrung</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">iterator</span> </li> </ul> Ticket Michel Morin Thu, 20 Aug 2015 11:22:17 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/11558#comment:2 https://svn.boost.org/trac10/ticket/11558#comment:2 <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">invalid</span> </li> </ul> <p> Your iterator is <code>InputIterator</code> (note: <code>reference</code> type of the iterator is <code>int</code>) but <code>std::next</code> requires <code>ForwardIterator</code>. Thus, the compilation fails if stdlib explicitly checks iterator requirements. </p> <p> So this is not a bug of Boost.Iterator and one can use <code>boost::next</code> in <code>&lt;boost/next_prior.hpp&gt;</code> to avoid this problem. </p> Ticket