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

履歴 編集

function
<chrono>

std::chrono::operator<=>(C++20)

namespace std::chrono {
  constexpr strong_ordering
    operator<=>(const month_day_last& x,
                const month_day_last& y) noexcept; // (1) C++20
}

概要

month_day_last同士の三方比較を行う。

戻り値

  • (1) :

return x.month() <=> y.month();

例外

投げない

備考

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

#include <cassert>
#include <chrono>

using namespace std::chrono;

int main()
{
  assert((March/last <=> March/last) == 0);

  assert(February/last < March/last);
  assert(February/last <= March/last);

  assert(March/last > February/last);
  assert(March/last >= February/last);
}

出力

バージョン

言語

  • C++20

処理系

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