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に対応する。
戻り値
typeがtype_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
処理系
- Clang: ??
- GCC: 16 (
-freflectionオプション指定) ✅ - Visual C++: ??