std::chrono::operator==(std::chrono::month_weekday) - cppreference.com (original) (raw)
| Member functions |
|---|
| month_weekday::month_weekday |
| month_weekday::monthmonth_weekday::weekday_indexed |
| month_weekday::ok |
| Nonmember functions |
| operator== |
| operator<< |
| Helper classes |
| formatterstd::chrono::month\_weekday |
| hashstd::chrono::month\_weekday(C++26) |
| Defined in header | | | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ------------- | | constexpr bool operator==( const std::chrono::month_weekday& x, const std::chrono::month_weekday& y ) noexcept; | | (since C++20) |
Compares the two month_weekday values x and y.
The != operator is synthesized from operator==.
[edit] Return value
x.month() == y.month() && x.weekday_indexed() == y.weekday_indexed()
[edit] Example
Run this code
#include int main() { constexpr auto mwdi1{std::chrono::March/std::chrono::Friday[1]}; constexpr auto mwdi2 { std::chrono::month_weekday { std::chrono::month(3), std::chrono::weekday(5)[1] } }; static_assert(mwdi1 == mwdi2); }