~ubuntu-branches/ubuntu/trusty/libc++/trusty

« back to all changes in this revision

Viewing changes to libcxx/test/thread/thread.threads/thread.thread.class/thread.thread.id/lt.pass.cpp

  • Committer: Package Import Robot
  • Author(s): Andrej Belym
  • Date: 2012-06-02 19:25:47 UTC
  • Revision ID: package-import@ubuntu.com-20120602192547-b6ta950a8ckc9um2
Tags: upstream-1.0~svn160132
ImportĀ upstreamĀ versionĀ 1.0~svn160132

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
// <thread>
 
11
 
 
12
// class thread::id
 
13
 
 
14
// bool operator< (thread::id x, thread::id y);
 
15
// bool operator<=(thread::id x, thread::id y);
 
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
    std::thread::id id2 = std::this_thread::get_id();
 
27
    assert(!(id0 <  id1));
 
28
    assert( (id0 <= id1));
 
29
    assert(!(id0 >  id1));
 
30
    assert( (id0 >= id1));
 
31
    assert( (id0 <  id2));
 
32
    assert( (id0 <= id2));
 
33
    assert(!(id0 >  id2));
 
34
    assert(!(id0 >= id2));
 
35
}