2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-11 23:52:29 +00:00

use C++11

This commit is contained in:
Oliver Kowalke
2014-12-27 19:07:42 +01:00
parent ddbdd91ced
commit 2f19be6d67
126 changed files with 19488 additions and 21505 deletions

24
examples/test_future.cpp Normal file
View File

@@ -0,0 +1,24 @@
#include <string>
#include <boost/bind.hpp>
#include <boost/fiber/all.hpp>
int foo( std::string const& str, int n)
{
for ( int i = 0; i < n; ++i)
{
std::cout << i << ": " << str << std::endl;
boost::this_fiber::yield();
}
return n;
}
void bar()
{
boost::fibers::future< int > fi(
boost::fibers::async(
boost::bind( foo, "abc", 5) ) );
fi.wait();
}