Namespaces
Variants
Views
Actions

operator==,!=,<,<=,>,>=,<=>(std::thread::id)

From cppreference.com
< cpp‎ | thread‎ | thread‎ | id
 
 
Thread support library
Threads
(C++11)
(C++20)
(C++20)
this_thread namespace
(C++11)
(C++11)
(C++11)
Mutual exclusion
(C++11)
Generic lock management
(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
(C++11)
(C++11)
Condition variables
(C++11)
Semaphores
Latches and barriers
(C++20)
(C++20)
Futures
(C++11)
(C++11)
(C++11)
(C++11)
 
 
std::thread::id
Member functions
Non-member functions
operator==operator!=operator<operator<=operator>operator>=operator<=>
(until C++20)(until C++20)(until C++20)(until C++20)(until C++20)(C++20)
Helper classes
 
bool operator==( thread::id lhs, thread::id rhs ) noexcept;
(1) (since C++11)
bool operator!=( thread::id lhs, thread::id rhs ) noexcept;
(2) (since C++11)
(until C++20)
bool operator<( thread::id lhs, thread::id rhs ) noexcept;
(3) (since C++11)
(until C++20)
bool operator<=( thread::id lhs, thread::id rhs ) noexcept;
(4) (since C++11)
(until C++20)
bool operator>( thread::id lhs, thread::id rhs ) noexcept;
(5) (since C++11)
(until C++20)
bool operator>=( thread::id lhs, thread::id rhs ) noexcept;
(6) (since C++11)
(until C++20)
std::strong_ordering operator<=>( thread::id lhs, thread::id rhs ) noexcept;
(7) (since C++20)

Compares two thread identifiers.

1-2) Checks whether lhs and rhs represent either the same thread, or no thread.
3-7) Compares lhs and rhs in an unspecified total ordering.

Contents

[edit] Parameters

lhs, rhs - thread identifiers to compare

[edit] Return value

1-6) true if the corresponding relation holds, false otherwise.
7) std::strong_ordering::less if lhs is less than rhs in the total ordering; otherwise std::strong_ordering::greater if rhs is less than lhs in the total ordering; otherwise std::strong_ordering::equal.

[edit] Complexity

Constant.

[edit] See also

C documentation for thrd_equal