// Copyright Oliver Kowalke 2009. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #include #include #include #include #include void fn() { std::cout << "inside function fn(): when fn() returns ::exit() will be called; no return to main()" << std::endl; } int main( int argc, char * argv[]) { { boost::contexts::context ctx( fn, boost::contexts::default_stacksize(), boost::contexts::no_stack_unwind, boost::contexts::exit_application); ctx.start(); } std::cout << "Done" << std::endl; return EXIT_SUCCESS; }