#include #include int main() { auto say = [](const T& t) { std::cout << "[" << boost::this_fiber::get_id() << "]: " << t << std::endl; }; boost::fibers::fiber f1([&] { say("f1"); boost::fibers::fiber f2(say, "f2"); f2.join(); say("f1"); }); f1.join(); }