#include #include #include using namespace std; using namespace std::placeholders; using namespace boost::coroutines; void Hello(coroutine::caller_type& ca) { cout << "In Hello " << ca.get() << endl; ca(); cout << "In Hello end " << ca.get() << endl; ca(); cout << "In Hello end " << ca.get() << endl; } int main(int argc, char **argv) { coroutine coro(Hello, 6); cout << "In Main1" << endl; int x = 4; while (coro) { coro(x++); } cout << "In Main2" << endl; return 0; }