От: | ELazin | http://rsdn.ru/forum/prj/6225353.1 Автор: ELazin Дата: 26.10.15 |
|
Дата: | 15.07.15 15:21 | ||
Оценка: |
#define BOOST_COROUTINES_BIDIRECT
#include <iostream>
#include <boost/coroutine/all.hpp>
typedef boost::coroutines::coroutine< void() > Coroutine;
typedef typename Coroutine::caller_type Caller;
void worker(Caller& caller) {
try {
std::cout << "about to throw exception" << std::endl;
throw std::runtime_error("weeeehaaaa");
} catch (const std::runtime_error& e) {
std::cout << e.what() << std::endl;
}
std::cout << "Done!" << std::endl;
}
int main()
{
Coroutine coro(&worker);
std::cout << "done" << std::endl;
return 0;
}