2 // Copyright Oliver Kowalke 2014.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
11 #include <boost/context/execution_context.hpp>
13 namespace ctx = boost::context;
17 ctx::execution_context< int > source(
18 [n](ctx::execution_context< int > && sink, int) mutable {
23 sink=std::move(std::get<0>(result));
28 return std::move( sink);
30 for(int i=0;i<10;++i){
31 auto result=source(i);
32 source=std::move(std::get<0>(result));
33 std::cout<<std::get<1>(result)<<" ";
37 std::cout << "main: done" << std::endl;