diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2015-04-08 03:09:47 +0000 |
---|---|---|
committer | <> | 2015-05-05 14:37:32 +0000 |
commit | f2541bb90af059680aa7036f315f052175999355 (patch) | |
tree | a5b214744b256f07e1dc2bd7273035a7808c659f /libs/thread/example/make_future.cpp | |
parent | ed232fdd34968697a68783b3195b1da4226915b5 (diff) | |
download | boost-tarball-master.tar.gz |
Imported from /home/lorry/working-area/delta_boost-tarball/boost_1_58_0.tar.bz2.HEADboost_1_58_0master
Diffstat (limited to 'libs/thread/example/make_future.cpp')
-rw-r--r-- | libs/thread/example/make_future.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/thread/example/make_future.cpp b/libs/thread/example/make_future.cpp index 399bb46f5..3b427e39f 100644 --- a/libs/thread/example/make_future.cpp +++ b/libs/thread/example/make_future.cpp @@ -104,6 +104,26 @@ int main() boost::future<int&> f = compute_ref(0); std::cout << f.get() << std::endl; } +#if __cplusplus > 201103L + { + std::cout << __FILE__ << " "<< __LINE__ << std::endl; + int i = 0; + boost::future<int&> f = boost::make_ready_future(std::ref(i)); + std::cout << f.get() << std::endl; + } +#endif + { + std::cout << __FILE__ << " "<< __LINE__ << std::endl; + int i = 0; + boost::future<int&> f = boost::make_ready_future(boost::ref(i)); + std::cout << f.get() << std::endl; + } + { + std::cout << __FILE__ << " "<< __LINE__ << std::endl; + const int i = 0; + boost::future<int const&> f = boost::make_ready_future(boost::cref(i)); + std::cout << f.get() << std::endl; + } // { // std::cout << __FILE__ << " "<< __LINE__ << std::endl; // boost::future<int> f = compute(2); |