31#ifndef ETL_IN_CHRONO_H
32 #error DO NOT DIRECTLY INCLUDE THIS FILE. USE CHRONO.H
76 ETL_NODISCARD ETL_CONSTEXPR14
bool ok() const ETL_NOEXCEPT
78 if (!m.ok() || !d.ok())
85 unsigned m_v =
static_cast<unsigned>(m);
86 max_day = private_chrono::days_in_month[m_v];
88 return (max_day > 0) && (
static_cast<unsigned>(d) >= 1) && (
static_cast<unsigned>(d) <= max_day);
124 return (lhs.day() == rhs.day()) && (lhs.month() == rhs.month());
132 return !(lhs == rhs);
140 if (lhs.month() < rhs.month())
144 else if (lhs.month() == rhs.month())
146 return lhs.day() < rhs.day();
185 auto cmp = lhs.month() <=> rhs.month();
193 return lhs.day() <=> rhs.day();
224 bool ok() const ETL_NOEXCEPT
237 if (m < other.month())
239 if (m > other.month())
255 return (
static_cast<unsigned>(mdl1.month()) ==
static_cast<unsigned>(mdl2.month()));
263 return !(mdl1 == mdl2);
271 return (lhs.month() < rhs.month());
305 return (
static_cast<unsigned>(mdl1.month()) <=>
static_cast<unsigned>(mdl2.month()));
313#if ETL_USING_8BIT_TYPES
317 size_t operator()(
const etl::chrono::month_day& md)
const
319 etl::chrono::month::rep m =
static_cast<etl::chrono::month::rep
>(
static_cast<unsigned>(md.
month()));
320 etl::chrono::day::rep d =
static_cast<etl::chrono::day::rep
>(
static_cast<unsigned>(md.
day()));
322 uint8_t buffer[
sizeof(m) +
sizeof(d)];
324 memcpy(buffer, &m,
sizeof(m));
325 memcpy(buffer +
sizeof(m), &d,
sizeof(d));
327 return etl::private_hash::generic_hash<size_t>(buffer, buffer +
sizeof(m) +
sizeof(d));
335#if ETL_USING_8BIT_TYPES
339 size_t operator()(
const etl::chrono::month_day_last& mdl)
const
341 etl::chrono::month::rep value =
static_cast<etl::chrono::month::rep
>(
static_cast<unsigned>(mdl.
month()));
342 const uint8_t* p =
reinterpret_cast<const uint8_t*
>(&value);
344 return etl::private_hash::generic_hash<size_t>(p, p +
sizeof(value));
Spaceship operator.
Definition month_day.h:202
ETL_NODISCARD ETL_CONSTEXPR14 int compare(const month_day &other) const ETL_NOEXCEPT
Definition month_day.h:235
ETL_CONSTEXPR14 month_day_last(const etl::chrono::month &m_) ETL_NOEXCEPT
Construct from month.
Definition month_day.h:208
ETL_CONSTEXPR14 etl::chrono::month month() const ETL_NOEXCEPT
Get the month.
Definition month_day.h:216
bool ok() const ETL_NOEXCEPT
Is the contained month OK?
Definition month_day.h:224
Definition month_day.h:40
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::month month() const ETL_NOEXCEPT
Returns the month.
Definition month_day.h:60
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::day day() const ETL_NOEXCEPT
Returns the day.
Definition month_day.h:68
ETL_NODISCARD ETL_CONSTEXPR14 bool ok() const ETL_NOEXCEPT
Returns true if the month/day is valid.
Definition month_day.h:76
ETL_CONSTEXPR14 month_day(const etl::chrono::month &m_, const etl::chrono::day &d_) ETL_NOEXCEPT
Construct from month and day.
Definition month_day.h:51
ETL_NODISCARD ETL_CONSTEXPR14 int compare(const month_day &other) const ETL_NOEXCEPT
Definition month_day.h:99
month_day()=default
Default constructor.
month
Definition month.h:54
ETL_CONSTEXPR14 bool operator<(const etl::chrono::day &d1, const etl::chrono::day &d2) ETL_NOEXCEPT
Less-than operator.
Definition day.h:182
ETL_CONSTEXPR14 bool operator>=(const etl::chrono::day &d1, const etl::chrono::day &d2) ETL_NOEXCEPT
Greater-than-or-equal operator.
Definition day.h:206
ETL_CONSTEXPR14 bool operator==(const etl::chrono::day &d1, const etl::chrono::day &d2) ETL_NOEXCEPT
Equality operator.
Definition day.h:166
ETL_CONSTEXPR14 bool operator<=(const etl::chrono::day &d1, const etl::chrono::day &d2) ETL_NOEXCEPT
Less-than-or-equal operator.
Definition day.h:190
ETL_CONSTEXPR14 bool operator!=(const etl::chrono::day &d1, const etl::chrono::day &d2) ETL_NOEXCEPT
Inequality operator.
Definition day.h:174
ETL_CONSTEXPR14 bool operator>(const etl::chrono::day &d1, const etl::chrono::day &d2) ETL_NOEXCEPT
Greater-than operator.
Definition day.h:198
bitset_ext
Definition absolute.h:40