31#ifndef ETL_IN_CHRONO_H
32 #error DO NOT DIRECTLY INCLUDE THIS FILE. USE CHRONO.H
87 for (
int offset =
static_cast<int>(dy) - 7; offset > 0; offset -= 7)
160 return y.
ok() && m.
ok() && wdi.
ok();
271 return (
lhs.year() ==
rhs.year()) &&
272 (
lhs.month() ==
rhs.month()) &&
273 (
lhs.weekday() ==
rhs.weekday());
391 unsigned d =
static_cast<unsigned>(
last_day);
485 return (
lhs.year() ==
rhs.year()) &&
486 (
lhs.month() ==
rhs.month()) &&
487 (
lhs.weekday() ==
rhs.weekday());
503#if ETL_USING_8BIT_TYPES
505 struct hash<
etl::chrono::year_month_weekday>
509 etl::chrono::year::rep y =
static_cast<etl::chrono::year::rep
>(
static_cast<unsigned>(ymwd.
year()));
510 etl::chrono::month::rep m =
static_cast<etl::chrono::month::rep
>(
static_cast<unsigned>(ymwd.
month()));
513 uint8_t buffer[
sizeof(y) +
sizeof(m) +
sizeof(wd)];
515 memcpy(buffer, &y,
sizeof(y));
516 memcpy(buffer +
sizeof(y), &m,
sizeof(m));
517 memcpy(buffer +
sizeof(y) +
sizeof(m), &wd,
sizeof(wd));
519 return etl::private_hash::generic_hash<size_t>(buffer, buffer +
sizeof(y) +
sizeof(m) +
sizeof(wd));
527#if ETL_USING_8BIT_TYPES
529 struct hash<
etl::chrono::year_month_weekday_last>
533 etl::chrono::year::rep y =
static_cast<etl::chrono::year::rep
>(
static_cast<unsigned>(ymwdl.
year()));
534 etl::chrono::month::rep m =
static_cast<etl::chrono::month::rep
>(
static_cast<unsigned>(ymwdl.
month()));
537 uint8_t buffer[
sizeof(y) +
sizeof(m) +
sizeof(wd)];
539 memcpy(buffer, &y,
sizeof(y));
540 memcpy(buffer +
sizeof(y), &m,
sizeof(m));
541 memcpy(buffer +
sizeof(y) +
sizeof(m), &wd,
sizeof(wd));
543 return etl::private_hash::generic_hash<size_t>(buffer, buffer +
sizeof(y) +
sizeof(m) +
sizeof(wd));
ETL_CONSTEXPR day() ETL_NOEXCEPT
Default constructor.
Definition day.h:51
duration
Definition duration.h:108
Spaceship operator.
Definition month_day.h:215
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
Definition time_point.h:45
weekday_indexed
Definition weekday.h:344
ETL_NODISCARD ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::weekday weekday() const ETL_NOEXCEPT
Get weekday.
Definition weekday.h:389
ETL_NODISCARD ETL_NODISCARD ETL_CONSTEXPR14 bool ok() const ETL_NOEXCEPT
Returns true if the weekday and index are valid.
Definition weekday.h:407
ETL_NODISCARD ETL_NODISCARD ETL_CONSTEXPR14 unsigned index() const ETL_NOEXCEPT
Get index.
Definition weekday.h:398
ETL_CONSTEXPR weekday_indexed() ETL_NOEXCEPT
Default constructor.
Definition weekday.h:350
weekday_last
Definition weekday.h:439
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::weekday weekday() const ETL_NOEXCEPT
Get weekday.
Definition weekday.h:471
weekday
Definition weekday.h:54
ETL_NODISCARD ETL_CONSTEXPR14 unsigned c_encoding() const ETL_NOEXCEPT
Get the C encoding of the weekday.
Definition weekday.h:212
Spaceship operator.
Definition year_month_day.h:473
year_month_day
Definition year_month_day.h:45
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::year year() const ETL_NOEXCEPT
Returns the year.
Definition year_month_day.h:141
year_month_weekday_last
Definition year_month_weekday.h:289
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::weekday weekday() const ETL_NOEXCEPT
Returns the weekday.
Definition year_month_weekday.h:326
ETL_CONSTEXPR14 year_month_weekday_last(const etl::chrono::year &y_, const etl::chrono::month &m_, const etl::chrono::weekday_last &wdl_) ETL_NOEXCEPT
Construct from year, month, weekday_last.
Definition year_month_weekday.h:295
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::weekday_last weekday_last() const ETL_NOEXCEPT
Returns the weekday_last.
Definition year_month_weekday.h:335
ETL_NODISCARD ETL_CONSTEXPR14 operator etl::chrono::sys_days() const ETL_NOEXCEPT
Converts to etl::chrono::sys_days.
Definition year_month_weekday.h:384
ETL_NODISCARD ETL_CONSTEXPR14 operator etl::chrono::local_days() const ETL_NOEXCEPT
Converts to etl::chrono::local_days.
Definition year_month_weekday.h:413
ETL_CONSTEXPR14 etl::chrono::year_month_weekday_last & operator-=(const etl::chrono::years &dy) ETL_NOEXCEPT
Subtracts etl::chrono::years.
Definition year_month_weekday.h:363
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::month month() const ETL_NOEXCEPT
Returns the month.
Definition year_month_weekday.h:317
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::year year() const ETL_NOEXCEPT
Returns the year.
Definition year_month_weekday.h:308
ETL_CONSTEXPR14 etl::chrono::year_month_weekday_last & operator+=(const etl::chrono::years &dy) ETL_NOEXCEPT
Adds etl::chrono::years.
Definition year_month_weekday.h:343
year_month_weekday
Definition year_month_weekday.h:43
ETL_CONSTEXPR14 year_month_weekday(const etl::chrono::year &y_, const etl::chrono::month &m_, const etl::chrono::weekday_indexed &wdi_) ETL_NOEXCEPT
Construct from month, day, and weekday_indexed.
Definition year_month_weekday.h:59
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::weekday weekday() const ETL_NOEXCEPT
Returns the weekday.
Definition year_month_weekday.h:131
ETL_CONSTEXPR14 year_month_weekday(const etl::chrono::sys_days &sd) ETL_NOEXCEPT
Construct from sys_days.
Definition year_month_weekday.h:71
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::year year() const ETL_NOEXCEPT
Returns the year.
Definition year_month_weekday.h:113
ETL_NODISCARD ETL_CONSTEXPR14 operator etl::chrono::sys_days() const ETL_NOEXCEPT
Converts to etl::chrono::sys_days.
Definition year_month_weekday.h:167
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::weekday_indexed weekday_indexed() const ETL_NOEXCEPT
Returns the weekday_indexed.
Definition year_month_weekday.h:149
ETL_CONSTEXPR14 year_month_weekday(const etl::chrono::local_days &ld) ETL_NOEXCEPT
Construct from local_days.
Definition year_month_weekday.h:100
ETL_NODISCARD ETL_CONSTEXPR14 operator etl::chrono::local_days() const ETL_NOEXCEPT
Converts to etl::chrono::local_days.
Definition year_month_weekday.h:199
ETL_NODISCARD ETL_CONSTEXPR14 unsigned index() const ETL_NOEXCEPT
Returns the weekday index.
Definition year_month_weekday.h:140
ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::month month() const ETL_NOEXCEPT
Returns the month.
Definition year_month_weekday.h:122
ETL_NODISCARD ETL_CONSTEXPR14 bool ok() const ETL_NOEXCEPT
Returns true if the year/month/day is valid.
Definition year_month_weekday.h:158
ETL_CONSTEXPR year_month_weekday()
Default constructor.
Definition year_month_weekday.h:49
ETL_CONSTEXPR year() ETL_NOEXCEPT
Default constructor.
Definition year.h:51
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