2
0
mirror of https://github.com/boostorg/context.git synced 2026-01-30 07:42:46 +00:00

refactor execution-context

This commit is contained in:
Oliver Kowalke
2015-11-29 11:23:14 +01:00
parent 9bca6eaf6b
commit d564cccf82
11 changed files with 472 additions and 848 deletions

View File

@@ -92,10 +92,8 @@ int main() {
std::istringstream is("1+1");
bool done=false;
std::exception_ptr except;
// create handle to main execution context
auto main_ctx( boost::context::execution_context::current() );
// execute parser in new execution context
boost::context::execution_context parser_ctx(
[&main_ctx,&is,&done,&except](void*){
@@ -131,9 +129,7 @@ int main() {
std::rethrow_exception( except);
}
}
std::cout << "main: done" << std::endl;
return EXIT_SUCCESS;
} catch ( std::exception const& e) {
std::cerr << "exception: " << e.what() << std::endl;