Skip to content

Latest commit

 

History

History
60 lines (44 loc) · 1.12 KB

op_equal.md

File metadata and controls

60 lines (44 loc) · 1.12 KB

operator==

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

概要

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

戻り値

コンストラクタで設定されて保持している曜日を表す値wdがあるとして、以下を返す:

return x.wd == y.wd;

例外

投げない

備考

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

#include <cassert>
#include <chrono>

namespace chrono = std::chrono;

int main()
{
  assert(chrono::Sunday == chrono::Sunday);
  assert(chrono::Sunday != chrono::Tuesday);
}
  • chrono::Sunday[link /reference/chrono/weekday_constants.md]
  • chrono::Tuesday[link /reference/chrono/weekday_constants.md]

出力

バージョン

言語

  • C++20

処理系

  • Clang: 8.0
  • GCC: (9.2時点で実装なし)
  • Visual C++: (2019 Update 3時点で実装なし)