• Class / Function / Type

      std::
    • Header file

      <>
    • Other / All

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

    履歴 編集

    <utility>

    std::pair::推論補助

    namespace std {
      template <class T1, class T2>
      pair(T1, T2) -> pair<T1, T2>;
    }
    

    概要

    std::pairクラステンプレートの型推論補助。

    備考

    #include <utility>
    #include <type_traits>
    
    int main()
    {
      std::pair p {3, "Hello"};
      static_assert(std::is_same_v<
        decltype(p),
        std::pair<int, const char*>
      >);
    }
    

    出力

    バージョン

    言語

    • C++17

    処理系

    関連項目

    参照