std::chrono:: operator== (std::chrono::weekday)
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
| Nonmember functions | ||||
|
operator==
|
||||
| Helper classes | ||||
|
(C++26)
|
|
定義於ヘッダ
<chrono>
|
||
|
constexpr
bool
operator
==
(
const
std::
chrono
::
weekday
&
x,
const std:: chrono :: weekday & y ) noexcept ; |
(C++20以降) | |
2つの std::chrono::weekday x と y を比較します。
!=
演算子は
synthesized
され、
operator==
から生成されます。
戻り値
x. c_encoding ( ) == y. c_encoding ( )
注記
weekday
は
<
、
<=
、
>
および
>=
演算子をサポートしていません。これは、週の最初の日が何日であるかについて普遍的な合意が存在しないためです。
例
#include <chrono> int main() { using namespace std::literals; constexpr std::chrono::weekday wd1{2}; constexpr std::chrono::weekday wd2{std::chrono::Friday}; static_assert(wd1 != wd2); // 1313年1月13日は金曜日 constexpr std::chrono::weekday wd3{1313y/1/13d}; static_assert(wd2 == wd3); }