summaryrefslogtreecommitdiff
path: root/libs/thread/example/make_future.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/thread/example/make_future.cpp')
-rw-r--r--libs/thread/example/make_future.cpp20
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);