]> git.ipfire.org Git - thirdparty/gcc.git/blame - libstdc++-v3/testsuite/30_threads/thread/id/operators.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 30_threads / thread / id / operators.cc
CommitLineData
52066eae 1// { dg-do compile { target c++11 } }
d7afcd2b
BK
2// { dg-require-gthreads "" }
3
7adcbafe 4// Copyright (C) 2009-2022 Free Software Foundation, Inc.
d7afcd2b
BK
5//
6// This file is part of the GNU ISO C++ Library. This library is free
7// software; you can redistribute it and/or modify it under the
8// terms of the GNU General Public License as published by the
748086b7 9// Free Software Foundation; either version 3, or (at your option)
d7afcd2b
BK
10// any later version.
11
12// This library is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16
17// You should have received a copy of the GNU General Public License along
748086b7
JJ
18// with this library; see the file COPYING3. If not see
19// <http://www.gnu.org/licenses/>.
d7afcd2b
BK
20
21#include <thread>
22
c7b591f3
JW
23template<typename Expected, typename T>
24 struct check_type
25 : std::false_type
26 { };
27
28template<typename Expected>
29 struct check_type<Expected, Expected>
30 : std::true_type
31 { };
32
d7afcd2b
BK
33void test01()
34{
35 // thread::id operators
36 std::thread::id id1;
37 std::thread::id id2;
38
c7b591f3
JW
39 static_assert( check_type<bool, decltype(id1 == id2)>{} );
40 static_assert( check_type<bool, decltype(id1 != id2)>{} );
41 static_assert( check_type<bool, decltype(id1 < id2)>{} );
42 static_assert( check_type<bool, decltype(id1 > id2)>{} );
43 static_assert( check_type<bool, decltype(id1 >= id2)>{} );
44 static_assert( check_type<bool, decltype(id1 <= id2)>{} );
d7afcd2b 45}