Skip to content

Latest commit

 

History

History
57 lines (42 loc) · 1.14 KB

File metadata and controls

57 lines (42 loc) · 1.14 KB

is_function_template

  • meta[meta header]
  • std::meta[meta namespace]
  • function[meta id-type]
  • cpp26[meta cpp]
namespace std::meta {
  consteval bool is_function_template(info r);
}
  • info[link info.md]

概要

関数テンプレートであるかを判定する。

戻り値

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));
}
  • std::meta::is_function_template[color ff0000]

出力

バージョン

言語

  • C++26

処理系

参照