31#ifndef ETL_IN_CHRONO_H
32 #error DO NOT DIRECTLY INCLUDE THIS FILE. USE CHRONO.H
51 ETL_CONSTEXPR
year() ETL_NOEXCEPT
59 ETL_CONSTEXPR
explicit year(
unsigned value_) ETL_NOEXCEPT
129 value +=
static_cast<unsigned char>(ys.count());
139 value -=
static_cast<unsigned char>(ys.count());
148 ETL_CONSTEXPR14
bool ok() const ETL_NOEXCEPT
175 ETL_CONSTEXPR14
bool is_leap() const ETL_NOEXCEPT
177 return ((value % 4) == 0) &&
178 (((value % 100) != 0) ||
179 ((value % 400) == 0));
185 ETL_CONSTEXPR14
operator int() const ETL_NOEXCEPT
187 return static_cast<int>(value);
199 if (value < other.value)
return -1;
200 if (value > other.value)
return 1;
215 return (
static_cast<unsigned>(y1) ==
static_cast<unsigned>(y2));
231 return (
static_cast<unsigned>(y1) <
static_cast<unsigned>(y2));
239 return (
static_cast<unsigned>(y1) <=
static_cast<unsigned>(y2));
247 return (
static_cast<unsigned>(y1) >
static_cast<unsigned>(y2));
255 return (
static_cast<unsigned>(y1) >=
static_cast<unsigned>(y2));
264 return (
static_cast<unsigned>(y1) <=>
static_cast<unsigned>(y2));
326 return etl::chrono::years(
static_cast<int>(
static_cast<unsigned>(y1)) -
327 static_cast<int>(
static_cast<unsigned>(y2)));
334#if ETL_USING_8BIT_TYPES
336 struct hash<
etl::chrono::year>
340 etl::chrono::year::rep value =
static_cast<etl::chrono::year::rep
>(
static_cast<unsigned>(y));
341 const uint8_t* p =
reinterpret_cast<const uint8_t*
>(&value);
343 return etl::private_hash::generic_hash<size_t>(p, p +
sizeof(value));
349#if ETL_HAS_CHRONO_LITERALS_YEAR
352 inline namespace literals
354 inline namespace chrono_literals
359#if ETL_USING_VERBOSE_CHRONO_LITERALS
360 inline ETL_CONSTEXPR14 etl::chrono::year
operator ""_year(
unsigned long long y) ETL_NOEXCEPT
362 inline ETL_CONSTEXPR14 etl::chrono::year
operator ""_y(
unsigned long long y) ETL_NOEXCEPT
365 return etl::chrono::year(
static_cast<int16_t
>(y));
ETL_NODISCARD ETL_CONSTEXPR14 bool is_leap() const ETL_NOEXCEPT
Returns true if the year is a leap year.
Definition year.h:175
ETL_CONSTEXPR year() ETL_NOEXCEPT
Default constructor.
Definition year.h:51
ETL_CONSTEXPR14 etl::chrono::year & operator=(const etl::chrono::year &rhs) ETL_NOEXCEPT
Assignment operator.
Definition year.h:75
ETL_CONSTEXPR14 etl::chrono::year & operator--() ETL_NOEXCEPT
Pre-decrement operator.
Definition year.h:106
ETL_CONSTEXPR14 year(const etl::chrono::year &other) ETL_NOEXCEPT
Copy constructor.
Definition year.h:67
ETL_CONSTEXPR14 etl::chrono::year & operator++() ETL_NOEXCEPT
Pre-increment operator.
Definition year.h:85
ETL_CONSTEXPR year(unsigned value_) ETL_NOEXCEPT
Construct from unsigned.
Definition year.h:59
ETL_CONSTEXPR14 etl::chrono::year & operator-=(const etl::chrono::years &ys) ETL_NOEXCEPT
Minus-equals operator subtracting etl::chrono::years.
Definition year.h:137
static ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::year min() ETL_NOEXCEPT
The minimum year value for which ok() will return true.
Definition year.h:157
ETL_CONSTEXPR14 etl::chrono::year & operator+=(const etl::chrono::years &ys) ETL_NOEXCEPT
Plus-equals operator adding etl::chrono::years.
Definition year.h:127
ETL_NODISCARD ETL_CONSTEXPR14 int compare(const year &other) const ETL_NOEXCEPT
Definition year.h:197
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
static ETL_NODISCARD ETL_CONSTEXPR14 etl::chrono::year max() ETL_NOEXCEPT
The maximum year value for which ok() will return true.
Definition year.h:166
Definition integral_limits.h:516
bitset_ext
Definition absolute.h:39