]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/thread/test/test_9711.cpp
d8fd8e3e812aa63551463a9bf3a2b363be86584e
1 // Copyright (C) 2014 Vicente Botet
3 // Distributed under the Boost Software License, Version 1.0. (See accompanying
4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #define BOOST_THREAD_PROVIDES_FUTURE
7 #define BOOST_THREAD_PROVIDES_FUTURE_CONTINUATION
8 #include <boost/config.hpp>
9 #if ! defined BOOST_NO_CXX11_DECLTYPE
10 #define BOOST_RESULT_OF_USE_DECLTYPE
13 #include <boost/thread/future.hpp>
18 #if ! defined BOOST_NO_CXX11_LAMBDAS && ! (defined BOOST_MSVC && _MSC_VER < 1700)
19 boost::promise
<int> prom
;
20 boost::future
<int> futr
= prom
.get_future();
24 boost::future
<void> futr2
= futr
.then(boost::launch::deferred
,
25 [&] (boost::future
<int> f
) {
29 assert(17 == f
.get());
32 assert(futr2
.valid());
33 assert(!futr2
.is_ready());
34 assert(0 == callCount
);
37 assert(0 == callCount
);
40 assert(1 == callCount
);