std::chrono::operator==(std::chrono::weekday_last)
Von cppreference.com
< cpp | chrono | weekday last
| Definiert in Header <chrono> |
||
| constexpr bool operator==( const std::chrono::weekday_last& x, const std::chrono::weekday_last& y ) noexcept; |
(seit C++20) | |
Vergleicht die beiden weekday_last-Werte x und y.
Der Operator != wird aus operator== synthetisiert.
[bearbeiten] Rückgabewert
x.weekday() == y.weekday()
[bearbeiten] Beispiel
Führen Sie diesen Code aus
#include <chrono> #include <iostream> int main() { constexpr auto wdl1{std::chrono::Tuesday[std::chrono::last]}; constexpr std::chrono::weekday_last wdl2{std::chrono::weekday(2)}; std::cout << std::boolalpha << (wdl1 == wdl2) << ' ' << (wdl1 == std::chrono::Wednesday[std::chrono::last]) << '\n'; }
Ausgabe
true false