mirror of
https://github.com/boostorg/fiber.git
synced 2026-02-02 20:52:21 +00:00
test for multiple definitions
This commit is contained in:
24
examples/cpp03/test_future.cpp
Normal file
24
examples/cpp03/test_future.cpp
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user