Skip to content

Latest commit

 

History

History
61 lines (45 loc) · 999 Bytes

File metadata and controls

61 lines (45 loc) · 999 Bytes

operator==

  • chrono[meta header]
  • std::chrono[meta namespace]
  • function[meta id-type]
  • cpp20[meta cpp]
namespace std::chrono {
  constexpr bool operator==(const year_month& x, const year_month& y) noexcept; // (1) C++20
}

概要

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

戻り値

  • (1) :
return x.year() == y.year() && x.month() == y.month();
  • year()[link year.md]
  • month()[link month.md]

例外

投げない

備考

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

#include <cassert>
#include <chrono>

using namespace std::chrono_literals;

int main()
{
  assert(2020y/3 == 2020y/3);
  assert(2020y/3 != 2020y/2);
}
  • 2020y[link /reference/chrono/year/op_y.md]

出力

バージョン

言語

  • C++20

処理系