Home | History | Annotate | Download | only in thread.thread.id
      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 // <thread>
     13 
     14 // class thread::id
     15 
     16 // bool operator==(thread::id x, thread::id y);
     17 // bool operator!=(thread::id x, thread::id y);
     18 
     19 #include <thread>
     20 #include <cassert>
     21 
     22 int main()
     23 {
     24     std::thread::id id0;
     25     std::thread::id id1;
     26     id1 = id0;
     27     assert( (id1 == id0));
     28     assert(!(id1 != id0));
     29     id1 = std::this_thread::get_id();
     30     assert(!(id1 == id0));
     31     assert( (id1 != id0));
     32 }
     33