Exemplo n.º 1
0
void symCoC(boost::coroutines::symmetric_coroutine<int>::yield_type& yield)
{
    int i = yield.get();
    cout << "symCoC input: " << i << endl;
    yield();
    cout << "leaving symCoC" << endl;
}
Exemplo n.º 2
0
void symCoA(boost::coroutines::symmetric_coroutine<int>::yield_type& yield)
{
    int i = yield.get();
    cout << "symCoA input: " << i << endl;
    boost::coroutines::symmetric_coroutine<int>::call_type func(&symCoB);
    func(2);
    cout << "leaving symCoA" << endl;
}
void trampoline( coro::symmetric_coroutine< void* >::yield_type & yield)
{
    void * vp = yield.get();
    X * x = static_cast< X * >( vp);
    I i( yield);
    x->d = & i;
    i.suspend();
    i.run();
}
 void operator()( coro::symmetric_coroutine< bool >::yield_type & yield)
 {
     if ( yield)
         value1 = yield.get();
 }