std::chrono::operator==,<=>(std::chrono::year_month)
来自cppreference.com
< cpp | chrono | year month
constexpr bool operator==( const std::chrono::year_month& x, const std::chrono::year_month& y ) noexcept; |
(1) | (C++20 起) |
constexpr std::strong_ordering operator<=>( const std::chrono::year_month& x, const std::chrono::year_month& y ) noexcept; |
(2) | (C++20 起) |
比较二个 year_month
对象 x
与 y
。
返回值
1) x.year() == y.year() && x.month() == y.month()
2) x.year() <=> y.year() != 0 ? x.year() <=> y.year() : x.month() <=> y.month()