2 // Copyright Oliver Kowalke 2009.
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)
7 #include <boost/coroutine/all.hpp>
12 #include <boost/bind.hpp>
14 typedef boost::coroutines::symmetric_coroutine< void > coro_t;
16 coro_t::call_type * c1 = 0;
17 coro_t::call_type * c2 = 0;
19 void foo( coro_t::yield_type & yield)
21 std::cout << "foo1" << std::endl;
23 std::cout << "foo2" << std::endl;
25 std::cout << "foo3" << std::endl;
28 void bar( coro_t::yield_type & yield)
30 std::cout << "bar1" << std::endl;
32 std::cout << "bar2" << std::endl;
34 std::cout << "bar3" << std::endl;
37 int main( int argc, char * argv[])
39 coro_t::call_type coro1( foo);
40 coro_t::call_type coro2( bar);
44 std::cout << "Done" << std::endl;