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);
90 max_day = private_chrono::days_in_month[m_v];
92 return (max_day > 0) &&
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());
137 return !(lhs == rhs);
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();
237 bool ok() const ETL_NOEXCEPT
251 if (m < other.month())
return -1;
252 if (m > other.month())
return 1;
268 return (
static_cast<unsigned>(mdl1.month()) ==
static_cast<unsigned>(mdl2.month()));
277 return !(mdl1 == mdl2);
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
338 size_t operator()(
const etl::chrono::month_day& md)
const
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
360 size_t operator()(
const etl::chrono::month_day_last& mdl)
const
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));
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
bitset_ext
Definition absolute.h:39