std::chrono...hrono::day)(3)
π std::chrono::operator==,(std::chrono::day) π
okay bestie, welcome to the C++ Standard Libary manual page for std::chrono::operator==,(std::chrono::day) π the header is giving std::chrono...hrono::day)(3) energy, but the actual main character is comparing std::chrono::day values. no cap.
π NAME π
std::chrono::operator==,(std::chrono::day) β yep, that's the whole name, and it's literally the equality + spaceship comparison page for std::chrono::day. periodt β¨
β¨ Synopsis β¨
Defined in header <chrono>.
constexpr bool operator==( const std::chrono::day& x,
const std::chrono::day& y ) noexcept;
(1) (since C++20)
constexpr std::strong_ordering operator<=>( const std::chrono::day& x,
const std::chrono::day& y ) noexcept;
(2) (since C++20)
Compare the two std::chrono::day x and y π«Ά
The <, <=, >, >=, and != operators are synthesized from operator<=> and operator== respectively. slay π
π¦ Return value π¦
unsigned(x) == unsigned(y)unsigned(x) <=> unsigned(y)
πΈ Example πΈ
// Run this code
#include <chrono>
#include <iostream>
int main()
{
constexpr std::chrono::day x{13}, y{31};
static_assert(x != y);
if constexpr (constexpr auto res = x <=> y; res < 0)
std::cout << "x is less than y\n";
else if constexpr (res > 0)
std::cout << "x is greater than y\n";
else
std::cout << "x and y are equal\n";
using namespace std::literals::chrono_literals;
static_assert
(
(6d < 9d) && (6d == 6d) && (6d <= 9d) &&
(9d > 6d) && (9d != 6d) && (9d >= 6d)
);
}
β Output β
x is less than y
and that's the whole vibe π sourced from http://cppreference.com, dated 2024.06.10 β mwah πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms