blob: d108b42756e2350ea74d7ec7cecb387a971565c1 [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//===----------------------------------------------------------------------===//
Jonathan Roelofsb3fcc672014-09-05 19:45:05 +00009//
10// UNSUPPORTED: libcpp-has-no-threads
Eric Fiseliercb38f752015-08-28 05:06:04 +000011// UNSUPPORTED: c++98, c++03
Howard Hinnant8759d9d2010-08-28 21:01:06 +000012
13// <future>
14
15// class promise<R>
16
17// promise();
18
19#include <future>
20#include <cassert>
21
22int main()
23{
24 {
25 std::promise<int> p;
26 std::future<int> f = p.get_future();
27 assert(f.valid());
28 }
29 {
30 std::promise<int&> p;
31 std::future<int&> f = p.get_future();
32 assert(f.valid());
33 }
34 {
35 std::promise<void> p;
36 std::future<void> f = p.get_future();
37 assert(f.valid());
38 }
39}