31#ifndef ETL_IN_CHRONO_H
32 #error DO NOT DIRECTLY INCLUDE THIS FILE. USE CHRONO.H
80 ETL_CONSTEXPR14
bool ok()
const ETL_NOEXCEPT
82 if (!m.
ok() || !d.
ok())
89 unsigned m_v =
static_cast<unsigned>(m);
93 (
static_cast<unsigned>(d) >= 1) &&
94 (
static_cast<unsigned>(d) <=
max_day);
108 if (m <
other.m)
return -1;
109 if (m >
other.m)
return 1;
110 if (d <
other.d)
return -1;
111 if (d >
other.d)
return 1;
128 return (
lhs.day() ==
rhs.day()) && (
lhs.month() ==
rhs.month());
143 ETL_NODISCARD ETL_CONSTEXPR14
147 if (
lhs.month() <
rhs.month())
151 else if (
lhs.month() ==
rhs.month())
153 return lhs.day() <
rhs.day();
164 ETL_NODISCARD ETL_CONSTEXPR14
174 ETL_NODISCARD ETL_CONSTEXPR14
184 ETL_NODISCARD ETL_CONSTEXPR14
198 auto cmp =
lhs.month() <=>
rhs.month();
206 return lhs.day() <=>
rhs.day();
268 return (
static_cast<unsigned>(
mdl1.month()) ==
static_cast<unsigned>(
mdl2.month()));
283 ETL_NODISCARD ETL_CONSTEXPR14
287 return (
lhs.month() <
rhs.month());
293 ETL_NODISCARD ETL_CONSTEXPR14
303 ETL_NODISCARD ETL_CONSTEXPR14
313 ETL_NODISCARD ETL_CONSTEXPR14
326 return (
static_cast<unsigned>(
mdl1.month()) <=>
static_cast<unsigned>(
mdl2.month()));
334#if ETL_USING_8BIT_TYPES
336 struct hash<
etl::chrono::month_day>
340 etl::chrono::month::rep m =
static_cast<etl::chrono::month::rep
>(
static_cast<unsigned>(md.
month()));
341 etl::chrono::day::rep d =
static_cast<etl::chrono::day::rep
>(
static_cast<unsigned>(md.
day()));
343 uint8_t buffer[
sizeof(m) +
sizeof(d)];
345 memcpy(buffer, &m,
sizeof(m));
346 memcpy(buffer +
sizeof(m), &d,
sizeof(d));
348 return etl::private_hash::generic_hash<size_t>(buffer, buffer +
sizeof(m) +
sizeof(d));
356#if ETL_USING_8BIT_TYPES
358 struct hash<
etl::chrono::month_day_last>
362 etl::chrono::month::rep value =
static_cast<etl::chrono::month::rep
>(
static_cast<unsigned>(mdl.
month()));
363 const uint8_t* p =
reinterpret_cast<const uint8_t*
>(&value);
365 return etl::private_hash::generic_hash<size_t>(p, p +
sizeof(value));
ETL_NODISCARD ETL_CONSTEXPR14 bool ok() const ETL_NOEXCEPT
Returns true if the day is within the valid 1 to 31 range.
Definition day.h:159
Spaceship operator.
Definition month_day.h:215
ETL_NODISCARD ETL_CONSTEXPR14 int compare(const month_day &other) const ETL_NOEXCEPT
Definition month_day.h:249
ETL_CONSTEXPR14 month_day_last(const etl::chrono::month &m_) ETL_NOEXCEPT
Construct from month.
Definition month_day.h:221
ETL_CONSTEXPR14 etl::chrono::month month() const ETL_NOEXCEPT
Get the month.
Definition month_day.h:229
bool ok() const ETL_NOEXCEPT
Is the contained month OK?
Definition month_day.h:237
Definition month_day.h:40
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::month month() const ETL_NOEXCEPT
Returns the month.
Definition month_day.h:62
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::day day() const ETL_NOEXCEPT
Returns the day.
Definition month_day.h:71
ETL_NODISCARD ETL_CONSTEXPR14 bool ok() const ETL_NOEXCEPT
Returns true if the month/day is valid.
Definition month_day.h:80
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:106
month_day()=default
Default constructor.
month
Definition month.h:54
ETL_CONSTEXPR month() ETL_NOEXCEPT
Default constructor.
Definition month.h:62
ETL_NODISCARD ETL_CONSTEXPR14 bool ok() const ETL_NOEXCEPT
Returns true if the month is within the valid 1 to 31 range.
Definition month.h:161
bitset_ext
Definition absolute.h:38
ETL_NODISCARD ETL_CONSTEXPR14 T round_half_even_unscaled(T value) ETL_NOEXCEPT
Definition scaled_rounding.h:314