summaryrefslogtreecommitdiffstats
path: root/libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.id/assign.pass.cpp
blob: df4423644ea44bc4be56a00a5d804ecc64c503a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <thread>

// class thread::id

// id& operator=(const id&) = default;

#include <thread>
#include <cassert>

int main()
{
    std::thread::id id0;
    std::thread::id id1;
    id1 = id0;
    assert(id1 == id0);
    id1 = std::this_thread::get_id();
    assert(id1 != id0);
}
OpenPOWER on IntegriCloud