- chrono[meta header]
- std::chrono[meta namespace]
- function[meta id-type]
- cpp20[meta cpp]
namespace std::chrono {
constexpr bool operator==(const weekday_last& x, const weekday_last& y) noexcept; // (1) C++20
}
weekday_last
同士の等値比較を行う。
- (1) :
return x.weekday() == y.weekday();
- weekday()[link weekday.md]
投げない
- この演算子により、
operator!=
が使用可能になる
#include <cassert>
#include <chrono>
namespace chrono = std::chrono;
int main()
{
assert(chrono::Sunday[chrono::last] == chrono::Sunday[chrono::last]);
assert(chrono::Sunday[chrono::last] != chrono::Monday[chrono::last]);
}
- chrono::Sunday[link /reference/chrono/weekday_constants.md]
- chrono::Monday[link /reference/chrono/weekday_constants.md]
- chrono::last[link /reference/chrono/last_spec.md]
- C++20
- Clang: 8.0 [mark verified]
- GCC: 9.2 [mark noimpl]
- Visual C++: 2019 Update 3 [mark noimpl]