std::chrono::operator==(std::chrono::month_weekday_last)
來自 cppreference.com
< cpp | chrono | month_weekday_last
| 定義於標頭檔案 <chrono> |
||
| constexpr bool operator==( const std::chrono::month_weekday_last& x, const std::chrono::month_weekday_last& y ) noexcept; |
(C++20 起) | |
比較兩個 month_weekday_last 值 x 和 y。
!= 運算子由 operator== 合成。
[編輯] 返回值
x.month() == y.month() && x.weekday_last() == y.weekday_last()
[編輯] 示例
執行此程式碼
#include <chrono> int main() { constexpr std::chrono::month_weekday_last mwdl1 { std::chrono::March/std::chrono::Friday[std::chrono::last] }; constexpr std::chrono::month_weekday_last mwdl2 { std::chrono::March, std::chrono::Friday[std::chrono::last] }; static_assert(mwdl1 == mwdl2); }