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

履歴 編集

function
<atomic>

std::atomic::operator T(C++11)

operator T() const volatile noexcept; // (1) C++11
operator T() const noexcept;          // (2) C++11

概要

Tへの暗黙の型変換

テンプレートパラメータ制約

  • (1) :
    • C++20 : atomic<T>::is_always_lock_freetrueであること

戻り値

load()

例外

投げない

#include <iostream>
#include <atomic>

int main()
{
  std::atomic<int> x(1);

  int value = x;
  std::cout << value << std::endl;
}

出力

1

バージョン

言語

  • C++11

処理系

関連項目

参照