2
0
mirror of https://github.com/boostorg/thread.git synced 2026-01-26 07:02:12 +00:00

Thread: merge from trunk. 1.54

[SVN r83525]
This commit is contained in:
Vicente J. Botet Escriba
2013-03-23 01:48:21 +00:00
parent f9b257e368
commit b1a674869d
56 changed files with 3065 additions and 508 deletions

View File

@@ -10,6 +10,15 @@
int p1() { return 5; }
void p() { }
#if defined BOOST_THREAD_USES_MOVE
boost::future<void> void_compute()
{
return BOOST_THREAD_MAKE_RV_REF(boost::make_future());
}
#endif
boost::future<int> compute(int x)
{
if (x == 0) return boost::make_future(0);
@@ -30,10 +39,20 @@ boost::shared_future<int> shared_compute(int x)
int main()
{
#if defined BOOST_THREAD_USES_MOVE
{
boost::future<void> f = void_compute();
f.get();
}
#endif
{
boost::future<int> f = compute(2);
std::cout << f.get() << std::endl;
}
{
boost::future<int> f = compute(0);
std::cout << f.get() << std::endl;
}
{
boost::shared_future<int> f = shared_compute(2);
std::cout << f.get() << std::endl;