最終更新日時(UTC):
が更新

履歴 編集

function
<latch>

std::latch::コンストラクタ(C++20)

constexpr explicit latch(ptrdiff_t expected); // (1)
latch(const latch&) = delete;                 // (2)

latchオブジェクトの構築

  • (1) : カウンタ値をexpectedとして、latchオブジェクトの初期化を行う。
  • (2) : コピーコンストラクタ。コピー不可。

事前条件

expected >= 0 かつ expected <= max()

例外

投げない

#include <latch>

// カウンタ値1のラッチを定義
std::latch latch{1};

int main() {}

出力

バージョン

言語

  • C++20

処理系