Subject: [Boost-bugs] [Boost C++ Libraries] #6373: transform_iterator not preserving bidirectionality of std::map iterator
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-01-10 02:15:30
#6373: transform_iterator not preserving bidirectionality of std::map iterator
-------------------------------------------------------+--------------------
Reporter: JonT <jon@â¦> | Owner: dave
Type: Bugs | Status: new
Milestone: To Be Determined | Component: iterator
Version: Boost 1.49.0 | Severity: Problem
Keywords: transform_iterator bidirectional std::map |
-------------------------------------------------------+--------------------
Using transform_iterator on std::map iterator does not seem to preserve
bidirectionality.
{{{
#!cpp
map::iterator itend = data.end();
XIt xend = boost::make_transform_iterator(itend,xfunc());
XIt xlast = xend;
--xlast;
assert(xend != xlast); // succeeds !
xlast = xend;
std::advance(xlast,-1);
assert(xend != xlast); // fails !
}}}
See also [http://stackoverflow.com/questions/8783048/bidirectional-boost-
transform-iterator-as-with-stdmap StackOverflow Issue 8783048] for longer
(compilable) example.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6373> 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:08 UTC