2
0
mirror of https://github.com/boostorg/context.git synced 2026-01-22 17:12:17 +00:00
Files
context/example/exit.cpp
Oliver Kowalke b8fd549bac initial commit of boost.context
[SVN r76974]
2012-02-11 13:04:55 +00:00

34 lines
766 B
C++

// 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 <cstdlib>
#include <iostream>
#include <string>
#include <boost/context/all.hpp>
#include <boost/move/move.hpp>
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;
}