Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 1.36 KB

can_substitute.md

File metadata and controls

58 lines (41 loc) · 1.36 KB

can_substitute

  • meta[meta header]
  • std::meta[meta namespace]
  • function[meta id-type]
  • cpp26[meta cpp]
namespace std::meta {
  template <reflection_range R = std::initializer_list<info>>
  consteval bool can_substitute(info templ, R&& arguments);
}
  • info[link info.md]
  • reflection_range[link reflection_range.md]

概要

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

戻り値

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

例外

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

例

#include <meta>
#include <vector>

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

出力

バージョン

言語

  • C++26

処理系

関連項目

参照