Created
August 8, 2017 18:30
-
-
Save ztlpn/77a0ff1c0537f5ce8f81227c511b028b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <boost/coroutine2/all.hpp> | |
int main() | |
{ | |
try | |
{ | |
using Coro = boost::coroutines2::coroutine<void>; | |
Coro::pull_type coro([](Coro::push_type & yield) | |
{ | |
// yield(); | |
throw std::runtime_error("Error"); | |
}); | |
while (coro) | |
coro(); | |
} | |
catch (const std::exception & e) | |
{ | |
std::cerr << "Exception: " << e.what() << std::endl; | |
return 1; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment