Home | History | Annotate | Download | only in futures.promise
      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 // UNSUPPORTED: libcpp-has-no-threads
     11 
     12 // <future>
     13 
     14 // class promise<R>
     15 
     16 // promise();
     17 
     18 #include <future>
     19 #include <cassert>
     20 
     21 int main()
     22 {
     23     {
     24         std::promise<int> p;
     25         std::future<int> f = p.get_future();
     26         assert(f.valid());
     27     }
     28     {
     29         std::promise<int&> p;
     30         std::future<int&> f = p.get_future();
     31         assert(f.valid());
     32     }
     33     {
     34         std::promise<void> p;
     35         std::future<void> f = p.get_future();
     36         assert(f.valid());
     37     }
     38 }
     39