C++ 参考手册
- C++11
- C++14
- C++17
- C++20
- C++ 编译器支持情况表
- 独立与宿主实现
- C++ 语言
- C++ 关键词
- 预处理器
- C++ 标准库头文件
- 具名要求
- 功能特性测试 (C++20)
- 工具库
- 类型支持(基本类型、RTTI、类型特性)
- 概念库 (C++20)
- 错误处理
- 动态内存管理
- 日期和时间工具
- 字符串库
- 容器库
- 迭代器库
- 范围库 (C++20)
- 算法库
- 数值库
- 输入/输出库
- 文件系统库
- 本地化库
- 正则表达式库
- 原子操作库
- 线程支持库
- std::thread
- std::shared_timed_mutex
- std::shared_lock
- std::lock_guard
- std::hardware_destructive_interference_size, std::hardware_constructive_interference_size
- std::counting_semaphore, std::binary_semaphore
- std::jthread
- cpp/thread/barrier
- std::future
- std::thread::id
- std::hash<std::thread::id>
- operator==,!=,<,<=,>,>=,<=>(std::thread::id)
- operator<<(std::thread::id)
- std::swap(std::thread)
- std::stop_token
- std::stop_source
- std::stop_callback
- std::this_thread::get_id
- std::this_thread::yield
- std::this_thread::sleep_for
- std::this_thread::sleep_until
- std::mutex
- std::recursive_mutex
- std::shared_mutex
- std::timed_mutex
- std::recursive_timed_mutex
- std::scoped_lock
- std::unique_lock
- std::defer_lock_t, std::try_to_lock_t, std::adopt_lock_t
- std::lock
- std::try_lock
- std::defer_lock, std::try_to_lock, std::adopt_lock
- std::once_flag
- std::call_once
- std::condition_variable
- std::condition_variable_any
- std::notify_all_at_thread_exit
- std::cv_status
- std::latch
- std::promise
- std::shared_future
- std::packaged_task
- std::async
- std::launch
- std::future_status
- std::future_error
- std::future_category
- std::future_errc
- 注释
- 实验性 C++ 特性
- 有用的资源
- 索引
- std 符号索引
- 协程支持 (C++20)
- C++ 关键词
位置:首页 > C++ 参考手册 >线程支持库 >std::thread >std::thread::id > operator==,!=,<,<=,>,>=,<=>(std::thread::id)
operator==,!=,<,<=,>,>=,<=>(std::thread::id)
bool operator==( thread::id lhs, thread::id rhs ) noexcept; |
(1) | (C++11 起) |
bool operator!=( thread::id lhs, thread::id rhs ) noexcept; |
(2) | (C++11 起) (C++20 前) |
bool operator<( thread::id lhs, thread::id rhs ) noexcept; |
(3) | (C++11 起) (C++20 前) |
bool operator<=( thread::id lhs, thread::id rhs ) noexcept; |
(4) | (C++11 起) (C++20 前) |
bool operator>( thread::id lhs, thread::id rhs ) noexcept; |
(5) | (C++11 起) (C++20 前) |
bool operator>=( thread::id lhs, thread::id rhs ) noexcept; |
(6) | (C++11 起) (C++20 前) |
std::strong_ordering operator<=>( thread::id lhs, thread::id rhs ) noexcept; |
(7) | (C++20 起) |
比较二个线程标识符。
1-2) 检查
lhs
与 rhs
是否表示同一线程或均不表示线程。3-7) 以未指明的全序比较
lhs
与 rhs
。参数
lhs, rhs | - | 要比较的线程标识符 |
返回值
1-6) 若对应关系成立则为 true ,否则为
false
。7) 若在该全序中
lhs
小于 rhs
则为 std::strong_ordering::less ;否则若在该全序中 rhs
小于 lhs
则为 std::strong_ordering::greater ;否则为 std::strong_ordering::equal 。复杂度
常数。