Re: [Boost-bugs] [Boost C++ Libraries] #10847: Offset overloads of next() / prior() have stopped compiling for iterators that previously worked

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10847: Offset overloads of next() / prior() have stopped compiling for iterators that previously worked
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-06-30 13:10:45


#10847: Offset overloads of next() / prior() have stopped compiling for iterators
that previously worked
-------------------------------------+-------------------------------------
  Reporter: Tony Lewis | Owner: no-maintainer
  <tonyelewis@…> | Status: new
      Type: Bugs | Component: utility
 Milestone: Boost 1.58.0 | Severity: Regression
   Version: Boost 1.57.0 | Keywords:
Resolution: | next,prior,advance,iterator,category,type_traits,has_plus_assign,forward_iterator
-------------------------------------+-------------------------------------

Comment (by ivan.lelann@…):

 For the same reason, boost::next is broken with std::reverse_iterator
 (tested with GCC libstdc++ 5.1)

 {{{
 #include <list>
 #include <vector>
 #include <iostream>

 #include <boost/utility.hpp>

 int main()
 {
     std::list<int> ints {1,2,3,4,5,6,7};

     // begin/end OK with boost::next or std::next
     std::cout << *(std::next(begin(ints), 2)) << std::endl;
     std::cout << *(std::next(end(ints), -2)) << std::endl;

     std::cout << *(boost::next(begin(ints), 2)) << std::endl;
     std::cout << *(boost::next(end(ints), -2)) << std::endl;


     // rbegin/rend KO with boost::next
     std::cout << *(std::next(rbegin(ints), 2)) << std::endl;
     std::cout << *(std::next(rend(ints), -2)) << std::endl;

     // KO
     std::cout << *(boost::next(rbegin(ints), 2)) << std::endl;
     std::cout << *(boost::next(rend(ints), -2)) << std::endl;
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10847#comment:1>
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