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

履歴 編集

class template
<utility>

std::common_type(C++23)

namespace std {
  template<class T1, class T2, class U1, class U2>
    requires requires { typename pair<common_type_t<T1, U1>, common_type_t<T2, U2>>; }
  struct common_type<pair<T1, T2>, pair<U1, U2>> {
    using type = pair<common_type_t<T1, U1>, common_type_t<T2, U2>>;
  };
}

概要

pairについて、どちらからも変換可能な共通の型を取得できるようにするcommon_typeの特殊化である。

効果

pair<common_type_t<T1, U1>, common_type_t<T2, U2>>によって得られた型をメンバ型typeとして定義する。

備考

バージョン

言語

  • C++23

処理系

関連項目

参照