• Class / Function / Type

      std::
    • Header file

      <>
    • Other / All

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

    履歴 編集

    function
    <chrono>

    std::chrono::operator==

    namespace std::chrono {
      constexpr bool operator==(const month& x, const month& y) noexcept; // (1) C++20
    }
    

    概要

    month同士の等値比較を行う。

    戻り値

    • (1) : static_cast<unsigned int>(x) == static_cast<unsigned int>(y);

    例外

    投げない

    備考

    • この演算子により、operator!=が使用可能になる

    #include <cassert>
    #include <chrono>
    
    namespace chrono = std::chrono;
    
    int main()
    {
      assert(chrono::January == chrono::January);
      assert(chrono::January != chrono::February);
    }
    

    出力

    バージョン

    言語

    • C++20

    処理系