最終更新日時(UTC):
が更新

履歴 編集

function
<meta>

std::meta::can_substitute(C++26)

namespace std::meta {
  template <reflection_range R = std::initializer_list<info>>
  consteval bool can_substitute(info templ, R&& arguments);
}

概要

テンプレートにテンプレート引数を置換可能かを判定する。

戻り値

テンプレートtemplargumentsを置換した結果が妥当である場合にtrueを返す。そうでなければfalseを返す。

例外

templがテンプレートを表さない場合、またはargumentsの要素がテンプレート引数として使用可能な構成要素を表さない場合、std::meta::exception例外を送出する。

#include <meta>
#include <vector>

int main() {
  static_assert(std::meta::can_substitute(^^std::vector, {^^int}));
}

出力

バージョン

言語

  • C++26

処理系

関連項目

参照