Subject: [Boost-bugs] [Boost C++ Libraries] #9760: coroutine's iterators don't have == operator with const qualifier
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-03-09 12:39:59
#9760: coroutine's iterators don't have == operator with const qualifier
-----------------------------------------------+-----------------------
Reporter: Masahiro Nawata <kamo.tanabota@â¦> | Owner: olli
Type: Bugs | Status: new
Milestone: To Be Determined | Component: coroutine
Version: Boost 1.55.0 | Severity: Problem
Keywords: |
-----------------------------------------------+-----------------------
coroutine's iterators don't have operator== with const qualifier.
Therefore, the following code fails to compile:
{{{
#include <boost/coroutine/v2/coroutine.hpp>
#include <boost/range/adaptor/filtered.hpp>
#include <boost/range/iterator_range.hpp>
#include <iostream>
int main()
{
using namespace boost;
coroutines::coroutine<int>::pull_type
c([](coroutines::coroutine<int>::push_type& yield) {
for (int i = 0; i < 5; ++i) {
yield(i);
}
});
auto crange = make_iterator_range(begin(c), end(c));
for (auto n : crange
| adaptors::filtered([](int n){return n % 2 == 0;})) // the
filtered adaptor needs const operator==.
{
std::cout << n << std::endl;
}
}
}}}
In addition, the iterators don't also have const operator!=.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/9760> 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:15 UTC