Subject: [Boost-bugs] [Boost C++ Libraries] #11303: boost::next(i, n) compilation error with -D_GLIBCXX_DEBUG
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-05-14 11:34:24
#11303: boost::next(i,n) compilation error with -D_GLIBCXX_DEBUG
------------------------------+---------------------------
Reporter: pawels@⦠| Owner: no-maintainer
Type: Bugs | Status: new
Milestone: To Be Determined | Component: utility
Version: Boost 1.58.0 | Severity: Regression
Keywords: |
------------------------------+---------------------------
std::map provides bidirectional iterator while boost::next(i,n) tries
to use the plus-assign which is random iterator specific.
{{{
% g++ -Wall gcc-bug.cpp -c -Og -isystem
~/dvm/sandbox/buildenv/boost-1.58.0/include -D_GLIBCXX_DEBUG
In file included from /usr/include/c++/4.9.2/debug/map.h:33:0,
from /usr/include/c++/4.9.2/debug/map:33,
from /usr/include/c++/4.9.2/map:66,
from gcc-bug.cpp:2:
/usr/include/c++/4.9.2/debug/safe_iterator.h: In instantiation of
â__gnu_debug::_Safe_iterator<_Iterator, _Sequence>&
__gnu_debug::_Safe_iterator<_Iterator, _Sequence>::operator+=(const
difference_type&) [with _Iterator = std::_Rb_tree_iterator<std::pair<const
int, int> >; _Sequence = std::__debug::map<int, int>;
__gnu_debug::_Safe_iterator<_Iterator, _Sequence>::difference_type = long
int]â:
/home/pawels/dvm/sandbox/buildenv/boost-1.58.0/include/boost/next_prior.hpp:73:11:
required from âstatic T boost::next_prior_detail::next_impl1<T, Distance,
true>::call(T, Distance) [with T =
__gnu_debug::_Safe_iterator<std::_Rb_tree_iterator<std::pair<const int,
int> >, std::__debug::map<int, int> >; Distance = int]â
/home/pawels/dvm/sandbox/buildenv/boost-1.58.0/include/boost/next_prior.hpp:151:67:
required from âT boost::next(T, Distance) [with T =
__gnu_debug::_Safe_iterator<std::_Rb_tree_iterator<std::pair<const int,
int> >, std::__debug::map<int, int> >; Distance = int]â
gcc-bug.cpp:8:66: required from here
/usr/include/c++/4.9.2/debug/safe_iterator.h:357:13: error: no match for
âoperator+=â (operand types are âstd::_Rb_tree_iterator<std::pair<const
int, int> >â and âconst difference_type {aka const long int}â)
_M_current += __n;
^
}}}
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/11303> 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:18 UTC