Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 1.4 KB

File metadata and controls

57 lines (40 loc) · 1.4 KB

template_arguments_of

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

概要

テンプレートの特殊化のテンプレート引数のリフレクションを取得する。

戻り値

rがテンプレートの特殊化を表す場合、そのテンプレート引数のリフレクションを格納したstd::vectorオブジェクトを返す。has_template_arguments(r)trueであることが事前条件となる。

例外

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

#include <meta>
#include <vector>

int main() {
  static_assert(std::meta::template_arguments_of(^^std::vector<int>)[0] == ^^int);
}

出力

バージョン

言語

  • C++26

処理系

関連項目

参照