blob: 47aec02d36e662ef44e727b7b2151789cebc577f [file] [log] [blame]
Howard Hinnant8759d9d2010-08-28 21:01:06 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
Howard Hinnant412dbeb2010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnant8759d9d2010-08-28 21:01:06 +00007//
8//===----------------------------------------------------------------------===//
9
10// <future>
11
12// class promise<R>
13
14// promise();
15
16#include <future>
17#include <cassert>
18
19int 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}