rename to symmetric_coroutine_call<>

This commit is contained in:
Oliver Kowalke
2014-02-05 19:27:22 +01:00
parent baabddae44
commit 82a78583ff
19 changed files with 1231 additions and 1199 deletions

View File

@@ -17,9 +17,9 @@ std::vector< int > merge( std::vector< int > const& a, std::vector< int > const&
{
std::vector< int > c;
std::size_t idx_a = 0, idx_b = 0;
coro_t * other_a = 0, * other_b = 0;
coro_t::call_type * other_a = 0, * other_b = 0;
coro_t coro_a(
coro_t::call_type coro_a(
[&]( coro_t::yield_type & yield) {
while ( idx_a < a.size() )
{
@@ -31,7 +31,7 @@ std::vector< int > merge( std::vector< int > const& a, std::vector< int > const&
c.push_back( b[idx_b]);
});
coro_t coro_b(
coro_t::call_type coro_b(
[&]( coro_t::yield_type & yield) {
while ( idx_b < b.size() )
{

View File

@@ -13,10 +13,10 @@ typedef boost::coroutines::symmetric_coroutine< void > coro_t;
int main( int argc, char * argv[])
{
coro_t * other1 = 0;
coro_t * other2 = 0;
coro_t::call_type * other1 = 0;
coro_t::call_type * other2 = 0;
coro_t coro1(
coro_t::call_type coro1(
[&]( coro_t::yield_type & yield) {
std::cout << "foo1" << std::endl;
yield( * other2);
@@ -24,7 +24,7 @@ int main( int argc, char * argv[])
yield( * other2);
std::cout << "foo3" << std::endl;
});
coro_t coro2(
coro_t::call_type coro2(
[&]( coro_t::yield_type & yield) {
std::cout << "bar1" << std::endl;
yield( * other1);