1// Copyright (C) 2014 Vicente Botet
2//
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)
5
6#define BOOST_THREAD_VERSION 4
7
8#include <boost/thread/future.hpp>
9
10struct foo
11{
12 foo(int i_): i(i_) {}
13 int i;
14};
15
16int main()
17{
18 boost::promise<foo> p;
19 const foo f(42);
20 p.set_value(f);
21
22 // Clearly a const future ref isn't much use, but I needed to
23 // prove the problem wasn't me trying to copy a unique_future
24
25 const boost::future<foo>& fut = boost::make_ready_future( value: foo(42) );
26 return 0;
27}
28
29

source code of boost/libs/thread/test/test_10340.cpp