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

履歴 編集

function
<meta>

std::meta::has_automatic_storage_duration(C++26)

namespace std::meta {
  consteval bool has_automatic_storage_duration(info r);
}

概要

自動記憶域期間を持つかを判定する。

戻り値

rが自動記憶域期間を持つ変数を表す場合にtrueを返す。

#include <meta>

int global;

int main() {
  int local;
  static_assert(std::meta::has_automatic_storage_duration(^^local));
  static_assert(!std::meta::has_automatic_storage_duration(^^global));
}

出力

バージョン

言語

  • C++26

処理系

参照