[Boost-bugs] [Boost C++ Libraries] #11234: boost::asymmetric_coroutine doesn't compile when used with boost::range::algorithms

Subject: [Boost-bugs] [Boost C++ Libraries] #11234: boost::asymmetric_coroutine doesn't compile when used with boost::range::algorithms
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-04-24 09:51:16


#11234: boost::asymmetric_coroutine doesn't compile when used with
boost::range::algorithms
------------------------------+-----------------------
 Reporter: kozlov.taras@… | Owner: olli
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: coroutine
  Version: Boost 1.58.0 | Severity: Problem
 Keywords: |
------------------------------+-----------------------
 I've tried to use generators produced by boost::asymmetric_coroutines
 together with boost::range::algorithms (for example find_if) and it fails
 to compile.

 Following code raise compilation error

 {{{

 #include <boost/range/algorithm/count.hpp>
 #include <boost/coroutine/all.hpp>

 using namespace boost::range;
 using namespace boost::coroutines;

 asymmetric_coroutine<int>::pull_type make_dummy_range()
 {
     return
 asymmetric_coroutine<int>::pull_type([](asymmetric_coroutine<int>::push_type&
 yield)
     {
         yield(1);
     });
 }

 template<typename Range>
 void const_func(const Range& r)
 {
     auto b = boost::begin(r);
 }

 int _tmain(int argc, _TCHAR* argv[])
 {
     const_func(make_dummy_range());
         return 0;
 }

 }}}

 {{{
 c:\users\taras\documents\visual studio
 2012\projects\coroutine_bug\coroutine_bug\coroutine_bug.cpp(23): error
 C2027: use of undefined type
 'boost::coroutines::pull_coroutine<R>::const_iterator'
 1> with
 1> [
 1> R=int
 1> ]
 1>
 d:\work\3rdparty\boost_1_58_0\boost\coroutine\asymmetric_coroutine.hpp(812)
 : see declaration of
 'boost::coroutines::pull_coroutine<R>::const_iterator'
 1> with
 1> [
 1> R=int
 1> ]
 1> c:\users\taras\documents\visual studio
 2012\projects\coroutine_bug\coroutine_bug\coroutine_bug.cpp(28) : see
 reference to function template instantiation 'void
 const_func<boost::coroutines::pull_coroutine<R>>(const Range &)' being
 compiled
 1> with
 1> [
 1> R=int,
 1> Range=boost::coroutines::pull_coroutine<int>
 1> ]
 1>c:\users\taras\documents\visual studio
 2012\projects\coroutine_bug\coroutine_bug\coroutine_bug.cpp(23): error
 C2514: 'boost::coroutines::pull_coroutine<R>::const_iterator' : class has
 no constructors
 1> with
 1> [
 1> R=int
 1> ]
 1>
 d:\work\3rdparty\boost_1_58_0\boost\coroutine\asymmetric_coroutine.hpp(812)
 : see declaration of
 'boost::coroutines::pull_coroutine<R>::const_iterator'
 1> with
 1> [
 1> R=int
 1> ]
 1>
 1>Build FAILED.
 }}}

 The problem is that boost::asymmetric_coroutine::const_iterator is
 declared but never defined, see
 boost/coroutine/asymmetric_coroutine.hpp:180

 I detected this problem while was trying to migrate from Boost 1.55. With
 Boost 1.55 this code compiles and everything is fine.

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