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;
118 const etl::chrono::years& dy) ETL_NOEXCEPT
136 const etl::chrono::months& dm) ETL_NOEXCEPT
154 const etl::chrono::years& dy) ETL_NOEXCEPT
163 const etl::chrono::months& dm) ETL_NOEXCEPT
174 return etl::chrono::months(
static_cast<int>(((
int(ym1.year()) -
int(ym2.year())) * 12) + (
unsigned(ym1.month()) -
unsigned(ym2.month()))));
183 return (lhs.year() == rhs.year()) && (lhs.month() == rhs.month());
192 return !(lhs == rhs);
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
274 size_t operator()(
const etl::chrono::year_month& ym)
const
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));
month
Definition month.h:54
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
bitset_ext
Definition absolute.h:39