Skip to content

Latest commit

 

History

History
57 lines (40 loc) · 1.33 KB

File metadata and controls

57 lines (40 loc) · 1.33 KB

common_type

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

概要

複数の型の共通型を求める。std::common_typeに対応する。

戻り値

type_argsの各要素が表す型に対してstd::common_type相当の変換を適用した結果の型のリフレクションを返す。

例外

type_argsの各要素が型を表さない場合、std::meta::exception例外を送出する。

#include <meta>

int main() {
  static_assert(std::meta::common_type({^^int, ^^double}) == ^^double);
}

出力

バージョン

言語

  • C++26

処理系

関連項目

参照