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