std::counting_semaphore<LeastMaxValue>::max
來自 cppreference.com
< cpp | thread | counting semaphore (計數訊號量)
constexpr std::ptrdiff_t max() noexcept; |
(C++20 起) | |
返回內部計數器的最大可能值,該值大於或等於 LeastMaxValue
。
[編輯] 返回值
內部計數器的最大可能值,型別為 std::ptrdiff_t。
[編輯] 注意
對於特化 binary_semaphore
,LeastMaxValue
等於 1。
正如其名,LeastMaxValue
是最小最大值,而非實際最大值。因此 max() 可以返回一個比 LeastMaxValue
大的數。