Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 1.31 KB

File metadata and controls

57 lines (40 loc) · 1.31 KB

template_of

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

概要

テンプレートの特殊化からテンプレート自体のリフレクションを取得する。

戻り値

rがテンプレートの特殊化を表す場合、そのテンプレートのリフレクションを返す。has_template_arguments(r)trueであることが事前条件となる。

例外

has_template_arguments(r)falseの場合、std::meta::exception例外を送出する。

#include <meta>
#include <vector>

int main() {
  static_assert(std::meta::template_of(^^std::vector<int>) == ^^std::vector);
}

出力

バージョン

言語

  • C++26

処理系

関連項目

参照