31#ifndef ETL_IN_CHRONO_H
32 #error DO NOT DIRECTLY INCLUDE THIS FILE. USE CHRONO.H
84 ETL_CONSTEXPR14
bool ok()
const ETL_NOEXCEPT
86 return y.
ok() && m.
ok();
100 if (y <
other.y)
return -1;
101 if (y >
other.y)
return 1;
102 if (m <
other.m)
return -1;
103 if (m >
other.m)
return 1;
183 return (
lhs.year() ==
rhs.year()) && (
lhs.month() ==
rhs.month());
198 ETL_NODISCARD ETL_CONSTEXPR14
202 if (
lhs.year() <
rhs.year())
206 else if (
lhs.year() ==
rhs.year())
208 return lhs.month() <
rhs.month();
219 ETL_NODISCARD ETL_CONSTEXPR14
229 ETL_NODISCARD ETL_CONSTEXPR14
239 ETL_NODISCARD ETL_CONSTEXPR14
253 auto cmp =
lhs.year()<=>
rhs.year();
261 return lhs.month() <=>
rhs.month();
270#if ETL_USING_8BIT_TYPES
272 struct hash<
etl::chrono::year_month>
276 etl::chrono::year::rep y =
static_cast<etl::chrono::year::rep
>(
static_cast<unsigned>(ym.
year()));
277 etl::chrono::month::rep m =
static_cast<etl::chrono::month::rep
>(
static_cast<unsigned>(ym.
month()));
279 uint8_t buffer[
sizeof(y) +
sizeof(m)];
281 memcpy(buffer, &y,
sizeof(y));
282 memcpy(buffer +
sizeof(y), &m,
sizeof(m));
284 return etl::private_hash::generic_hash<size_t>(buffer, buffer +
sizeof(y) +
sizeof(m));
duration
Definition duration.h:108
month
Definition month.h:54
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
Definition year_month.h:40
ETL_CONSTEXPR year_month()
Default constructor.
Definition year_month.h:46
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::month month() const ETL_NOEXCEPT
Returns the month.
Definition year_month.h:75
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::year year() const ETL_NOEXCEPT
Returns the year.
Definition year_month.h:66
ETL_NODISCARD ETL_CONSTEXPR14 bool ok() const ETL_NOEXCEPT
Returns true if the month/day is valid.
Definition year_month.h:84
ETL_CONSTEXPR14 year_month(const etl::chrono::year &y_, const etl::chrono::month &m_) ETL_NOEXCEPT
Construct from month and day.
Definition year_month.h:55
ETL_NODISCARD ETL_CONSTEXPR14 int compare(const year_month &other) const ETL_NOEXCEPT
Definition year_month.h:98
ETL_NODISCARD ETL_CONSTEXPR14 bool ok() const ETL_NOEXCEPT
Returns true if the year is within the valid -32767 to 32767 range.
Definition year.h:148
bitset_ext
Definition absolute.h:38
ETL_NODISCARD ETL_CONSTEXPR14 T round_half_even_unscaled(T value) ETL_NOEXCEPT
Definition scaled_rounding.h:314