Subject: [Boost-bugs] [Boost C++ Libraries] #9984: range iterator failing to model forward_iterator
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-05-01 12:06:31
#9984: range iterator failing to model forward_iterator
---------------------------------------------+-----------------------------
Reporter: Akim Demaille <akim.demaille@â¦> | Owner:
Type: Bugs | jeffrey.hellrung
Milestone: To Be Determined | Status: new
Version: Boost 1.55.0 | Component: iterator
Keywords: clang | Severity: Problem
---------------------------------------------+-----------------------------
The following code snippet passes successfully with GCC 4.9, but Clang 3.5
(installed from MacPorts) fails to accept std::next.
The symptoms are somewhat alike #9431, but I have no idea if it's the same
issue. According to the code of irange, I guess the problem is rather
with Boost.Iterator.
{{{
$ cat bar.cc
#include <boost/range/irange.hpp>
int main()
{
auto range = boost::irange<int>(0, 10);
auto i = std::begin(range);
auto j = std::next(i);
std::cerr << *j << std::endl;
}
$ clang++-mp-3.5 -std=c++11 -I /opt/local/include bar.cc
bar.cc:7:12: error: no matching function for call to 'next'
auto j = std::next(i);
^~~~~~~~~
/opt/local/libexec/llvm-3.5/bin/../include/c++/v1/iterator:514:25: note:
candidate template
ignored: disabled by 'enable_if' [with _ForwardIter =
boost::range_detail::integer_iterator<int>]
typename enable_if<__is_forward_iterator<_ForwardIter>::value>::type*
= 0)
^
1 error generated.
$ g++-mp-4.9 -std=c++11 -I /opt/local/include bar.cc
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9984> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:16 UTC