[Boost-bugs] [Boost C++ Libraries] #8024: Unable to create const_iterator for coroutine

Subject: [Boost-bugs] [Boost C++ Libraries] #8024: Unable to create const_iterator for coroutine
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-10 08:08:21


#8024: Unable to create const_iterator for coroutine
------------------------------+---------------------------------------------
 Reporter: nathanridge | Owner: olli
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: coroutine
  Version: Boost 1.53.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------------------------------
 It seems to be impossible to create a const_iterator for a coroutine. For
 example, the following fails to compile:

 {{{
 #include <boost/coroutine/coroutine.hpp>

 typedef boost::coroutines::coroutine<int()> coroutine_type;

 void f(coroutine_type::caller_type& c) {}

 int main()
 {
     coroutine_type c(f);
     coroutine_type::const_iterator it = boost::begin(c);
 }
 }}}

 with the error:


 {{{
 test.cpp: In function 'int main()':
 test.cpp:10:55: error: conversion from
 'boost::range_iterator<boost::coroutines::coroutine<int()> >::type {aka
 boost::coroutines::detail::coroutine_op<int(),
 boost::coroutines::coroutine<int()>, int, 0>::iterator}' to non-scalar
 type 'boost::coroutines::detail::coroutine_op<int(),
 boost::coroutines::coroutine<int()>, int, 0>::const_iterator' requested
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8024>
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:12 UTC