1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // <future>
11 
12 // class promise<R>
13 
14 // promise();
15 
16 #include <future>
17 #include <cassert>
18 
main()19 int main()
20 {
21     {
22         std::promise<int> p;
23         std::future<int> f = p.get_future();
24         assert(f.valid());
25     }
26     {
27         std::promise<int&> p;
28         std::future<int&> f = p.get_future();
29         assert(f.valid());
30     }
31     {
32         std::promise<void> p;
33         std::future<void> f = p.get_future();
34         assert(f.valid());
35     }
36 }
37