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

履歴 編集

function template
<meta>

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

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

概要

例外を送出せずに呼び出し可能で戻り値が指定型に変換可能かを判定する。std::is_nothrow_invocable_rに対応する。

戻り値

typetype_args例外を送出せずに呼び出し可能で、戻り値type_resultに変換可能な場合にtrueを返す。

例外

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

#include <meta>

int f(double) noexcept { return 0; }
int g(double) { return 0; }  // noexceptでない

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

出力

バージョン

言語

  • C++26

処理系

関連項目

参照