31#ifndef ETL_IN_CHRONO_H
32 #error DO NOT DIRECTLY INCLUDE THIS FILE. USE CHRONO.H
80 ETL_NODISCARD ETL_CONSTEXPR14
bool ok() const ETL_NOEXCEPT
82 return y.ok() && m.ok();
134 int dmonths =
static_cast<int>(
static_cast<unsigned>(ym.month())) - 1 + dm.count();
135 int dyears = (dmonths - 11 * (dmonths < 0)) / 12;
136 dmonths -= dyears * 12;
170 return etl::chrono::months(
171 (ym1.year() - ym2.year())
172 + etl::chrono::months(
static_cast<int>(
static_cast<unsigned>(ym1.month())) -
static_cast<int>(
static_cast<unsigned>(ym2.month()))));
180 return (lhs.year() == rhs.year()) && (lhs.month() == rhs.month());
188 return !(lhs == rhs);
196 if (lhs.year() < rhs.year())
200 else if (lhs.year() == rhs.year())
202 return lhs.month() < rhs.month();
241 auto cmp = lhs.year() <=> rhs.year();
249 return lhs.month() <=> rhs.month();
258#if ETL_USING_8BIT_TYPES
262 size_t operator()(
const etl::chrono::year_month& ym)
const
264 etl::chrono::year::rep y =
static_cast<etl::chrono::year::rep
>(
static_cast<int>(ym.
year()));
265 etl::chrono::month::rep m =
static_cast<etl::chrono::month::rep
>(
static_cast<unsigned>(ym.
month()));
267 uint8_t buffer[
sizeof(y) +
sizeof(m)];
269 memcpy(buffer, &y,
sizeof(y));
270 memcpy(buffer +
sizeof(y), &m,
sizeof(m));
272 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:72
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::year year() const ETL_NOEXCEPT
Returns the year.
Definition year_month.h:64
ETL_NODISCARD ETL_CONSTEXPR14 bool ok() const ETL_NOEXCEPT
Returns true if the month/day is valid.
Definition year_month.h:80
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:93
ETL_CONSTEXPR14 etl::chrono::day operator+(const etl::chrono::day &d, const etl::chrono::days &ds) ETL_NOEXCEPT
Spaceship operator.
Definition day.h:226
ETL_CONSTEXPR14 etl::chrono::day operator-(const etl::chrono::day &d, const etl::chrono::days &ds) ETL_NOEXCEPT
Definition day.h:252
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