2
0
mirror of https://github.com/boostorg/context.git synced 2026-01-29 07:22:21 +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

@@ -23,16 +23,15 @@ public:
X():
excptr_(),
caller_(boost::context::execution_context::current()),
callee_(
[=]( void * vp){
try {
int i = * static_cast< int * >( vp);
std::string str = boost::lexical_cast<std::string>(i);
caller_( & str);
} catch (...) {
excptr_=std::current_exception();
}
})
callee_( [this]( void * vp){
try {
int i = * static_cast< int * >( vp);
std::string str = boost::lexical_cast<std::string>(i);
caller_( & str);
} catch (...) {
excptr_=std::current_exception();
}
})
{}
std::string operator()(int i){
@@ -48,4 +47,5 @@ int main() {
X x;
std::cout<<x(7)<<std::endl;
std::cout << "done" << std::endl;
return EXIT_SUCCESS;
}