Subject: [Boost-bugs] [Boost C++ Libraries] #7824: "++--rng.end() == rng.end()" can fail for strided ranges
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-12-22 07:53:10
#7824: "++--rng.end() == rng.end()" can fail for strided ranges
-------------------------------------+--------------------------------------
Reporter: michel | Owner: neilgroves
Type: Bugs | Status: new
Milestone: To Be Determined | Component: range
Version: Boost Development Trunk | Severity: Problem
Keywords: |
-------------------------------------+--------------------------------------
Attached a test case for which "`++--rng.end() == rng.end()`" fails.
Due to this bug, libc++'s `deque<T>::insert` function misunderstands
the size of strided ranges. For example,
{{{
using boost::strided_range;
using boost::adaptors::strided;
int ar[3] = {0, 1, 2};
strided_range<int[3]> rng = ar | strided(3);
std::deque<int> cont;
cont.insert(cont.begin(), rng.begin(), rng.end());
std::cout << cont.size() << std::endl;
}}}
outputs 2 (not 1) with libc++.
You can see `libs/range/test/adaptor_test/strided.cpp` fails
on test runners with libc++.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7824> 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:11 UTC