namespace std::meta {
consteval bool is_function_template(info r);
}
概要
関数テンプレートであるかを判定する。
戻り値
rが関数テンプレートを表す場合にtrueを返す。
例
#include <meta>
// 関数テンプレート
template <class T>
T add(T a, T b) { return a + b; }
// 通常の関数
int multiply(int a, int b) { return a * b; }
int main() {
static_assert(std::meta::is_function_template(^^add));
static_assert(!std::meta::is_function_template(^^multiply));
static_assert(!std::meta::is_function_template(^^int));
}
出力
バージョン
言語
- C++26
処理系
- Clang: ??
- GCC: 16 (
-freflectionオプション指定) ✅ - Visual C++: ??