2 // Copyright Oliver Kowalke 2014.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
11 #include <boost/context/all.hpp>
13 namespace ctx = boost::context;
15 ctx::execution_context< void > f1( ctx::execution_context< void > && ctx) {
16 std::cout << "f1: entered first time" << std::endl;
18 std::cout << "f1: entered second time" << std::endl;
20 std::cout << "f1: entered third time" << std::endl;
21 return std::move( ctx);
25 std::cout << "f2: entered" << std::endl;
29 ctx::execution_context< void > ctx( f1);
31 std::cout << "f1: returned first time" << std::endl;
33 std::cout << "f1: returned second time" << std::endl;
34 ctx = ctx( ctx::exec_ontop_arg, f2);
35 std::cout << "f1: returned third time" << std::endl;
37 std::cout << "main: done" << std::endl;