Re: [Boost-bugs] [Boost C++ Libraries] #13094: boost::adaptors::transform fails to preserve bidirectional behavior of range

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #13094: boost::adaptors::transform fails to preserve bidirectional behavior of range
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-06-24 00:52:08


#13094: boost::adaptors::transform fails to preserve bidirectional behavior of
range
-------------------------------------+-------------------------------------
  Reporter: Jake Cobb | Owner: neilgroves
  <jake.cobb@…> |
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: range
   Version: Boost 1.64.0 | Severity: Problem
Resolution: | Keywords: range adaptors
                                     | transform
-------------------------------------+-------------------------------------

Comment (by Jake Cobb <jake.cobb@…>):

 By the way I see this with both clang and Visual Studio libraries. It
 seems that `std::advance`, `std::prev`, etc are relying on
 `std::iterator_traits<Iter>::iterator_category` tag dispatch, which for
 `std::vector` yields:

 `std::random_access_iterator_tag`

 But for `boost::adaptors::transform` yields:

 `boost::iterators::detail::iterator_category_with_traversal<std::input_iterator_tag,
 boost::iterators::random_access_traversal_tag>`

 It looks like there may be code for boost to understand the standard
 library `iterator_category` tags in terms of traversals, but the opposite
 does not work; this causes behavior changes when passing to code using
 standard library conventions when the code is modified from passing
 standard types to boost adaptor types.

--
Ticket URL: <https://svn.boost.org/trac10/boost/ticket/13094#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-06-24 00:55:00 UTC