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

履歴 編集

function template
<meta>

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

namespace std::meta {
  template <reflection_range R = std::initializer_list<info>>
  consteval bool is_nothrow_invocable_type(info type, R&& type_args);
}

概要

例外を送出せずに呼び出し可能かを判定する。std::is_nothrow_invocableに対応する。

戻り値

typetype_args例外を送出せずに呼び出し可能な場合にtrueを返す。

例外

typeまたはtype_argsの各要素が型を表さない場合、std::meta::exception例外を送出する。

#include <meta>

void f(int) noexcept {}
void g(int) {}

int main() {
  static_assert(std::meta::is_nothrow_invocable_type(^^decltype(f), {^^int}));
  static_assert(!std::meta::is_nothrow_invocable_type(^^decltype(g), {^^int}));
}

出力

バージョン

言語

  • C++26

処理系

関連項目

参照