Completed chrono documentation

This commit is contained in:
John Wellbelove 2026-04-14 10:26:22 +02:00
parent 6604e8e40c
commit 7813d3ce7b
13 changed files with 729 additions and 440 deletions

View File

@ -1,5 +1,5 @@
---
title: "Duration"
title: "Durations"
weight: 100
---

View File

@ -1,5 +1,5 @@
---
title: "Month"
title: "Months"
weight: 100
---

View File

@ -1,88 +1,143 @@
month_weekday_last
---
title: "month_weekday_last"
---
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
Similar to: [std::chrono::month_weekday_last](https://en.cppreference.com/w/cpp/chrono/month_weekday_last.html)
{{< /callout >}}
A class representing a month and weekday_last.
Back to chrono
____________________________________________________________________________________________________
month_weekday_last
STL equivalent: std::chrono::month_weekday_last
```cpp
class month_weekday_last
____________________________________________________________________________________________________
Construction
```
## Construction
```cpp
ETL_CONSTEXPR
month_weekday_last()
```
**Description**
Default constructor.
______________________________________________
---
```cpp
ETL_CONSTEXPR14
month_weekday_last(const etl::chrono::month& m,
const etl::chrono::weekday_last& wd)
ETL_NOEXCEPT
Construct from month and weekday_last.
____________________________________________________________________________________________________
Access
```
**Description**
Construct from `month` and `weekday_last`.
## Access
```cpp
ETL_NODISCARD
ETL_CONSTEXPR14
etl::chrono::month month() const
ETL_NOEXCEPT
Returns the month.
______________________________________________
```
**Return**
The month.
---
```cpp
ETL_NODISCARD
ETL_CONSTEXPR14
etl::chrono::weekday_last weekday_last() const
ETL_NOEXCEPT
Returns the weekday.
____________________________________________________________________________________________________
Tests
```
**Return**
The weekday.
## Tests
```cpp
ETL_NODISCARD
ETL_CONSTEXPR14
bool ok() const
ETL_NOEXCEPT
Returns true if the month and day is within the valid limits.
____________________________________________________________________________________________________
Non-member comparison operators
```
**Return**
`true` if the month and day is within the valid limits.
## Non-member comparison operators
```cpp
ETL_CONSTEXPR14
bool operator ==(const etl::chrono::month_weekday_last& lhs,
const etl::chrono::month_weekday_last& rhs)
ETL_NOEXCEPT
```
**Description**
Equality operator.
______________________________________________
---
```cpp
ETL_CONSTEXPR14
bool operator !=(const etl::chrono::month_weekday_last& lhs,
const etl::chrono::month_weekday_last& rhs)
ETL_NOEXCEPT
```
**Description**
Inequality operator.
______________________________________________
ETL_CONSTEXPR14
bool operator <(const etl::chrono::month_weekday_last& lhs,
const etl::chrono::month_weekday_last& rhs)
ETL_NOEXCEPT
Less-than operator.
______________________________________________
ETL_CONSTEXPR14
bool operator <=(const etl::chrono::month_weekday_last& lhs,
const etl::chrono::month_weekday_last& rhs)
ETL_NOEXCEPT
Less-than-equal operator.
______________________________________________
ETL_CONSTEXPR14
bool operator <(const etl::chrono::month_weekday_last& lhs,
const etl::chrono::month_weekday_last& rhs)
ETL_NOEXCEPT
Greater-than operator.
______________________________________________
ETL_CONSTEXPR14
bool operator <=(const etl::chrono::month_weekday_last& lhs,
const etl::chrono::month_weekday_last& rhs)
ETL_NOEXCEPT
Greater-than-equal operator.
____________________________________________________________________________________________________
Hash
---
```cpp
ETL_CONSTEXPR14
bool operator <(const etl::chrono::month_weekday_last& lhs,
const etl::chrono::month_weekday_last& rhs)
ETL_NOEXCEPT
```
**Description**
Less-than operator.
---
```cpp
ETL_CONSTEXPR14
bool operator <=(const etl::chrono::month_weekday_last& lhs,
const etl::chrono::month_weekday_last& rhs)
ETL_NOEXCEPT
```
**Description**
Less-than-equal operator.
---
```cpp
ETL_CONSTEXPR14
bool operator <(const etl::chrono::month_weekday_last& lhs,
const etl::chrono::month_weekday_last& rhs)
ETL_NOEXCEPT
```
**Description**
Greater-than operator.
---
```cpp
ETL_CONSTEXPR14
bool operator <=(const etl::chrono::month_weekday_last& lhs,
const etl::chrono::month_weekday_last& rhs)
ETL_NOEXCEPT
```
**Description**
Greater-than-equal operator.
## Hash
```cpp
template <typename TRep, typename TPeriod>
struct hash<etl::chrono::month_weekday_last>
Hash function for etl::chrono::month_weekday_last
```
**Description**
Hash function for `etl::chrono::month_weekday_last`.

View File

@ -1,5 +1,5 @@
---
title: "operators"
title: "Operators"
---
{{< callout type="info">}}

View File

@ -1,5 +1,5 @@
---
title: "Weekday"
title: "Weekdays"
weight: 100
---

View File

@ -1,218 +1,372 @@
weekday
---
title: "weekday"
---
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
Similar to: [std::chrono::weekday](https://en.cppreference.com/w/cpp/chrono/weekday.html)
{{< /callout >}}
A class representing a weekday.
Back to chrono
____________________________________________________________________________________________________
weekday
STL equivalent: std::chrono::weekday
```cpp
class weekday
____________________________________________________________________________________________________
Construction
```
## Construction
```cpp
ETL_CONSTEXPR
weekday()
ETL_NOEXCEPT
```
**Description**
Default constructor.
______________________________________________
---
```cpp
ETL_CONSTEXPR
explicit weekday(unsigned value)
ETL_NOEXCEPT
Construct from unsigned.
______________________________________________
```
**Description**
Construct from `unsigned`.
---
```cpp
ETL_CONSTEXPR14
weekday(const etl::chrono::sys_days& sd)
ETL_NOEXCEPT
Construct from sys_days.
______________________________________________
```
**Description**
Construct from `sys_days`.
---
```cpp
ETL_CONSTEXPR14
weekday(const etl::chrono::local_days& sd)
ETL_NOEXCEPT
Construct from local_days.
______________________________________________
```
**Description**
Construct from `local_days`.
---
```cpp
ETL_CONSTEXPR14
weekday(const etl::chrono::weekday& other)
ETL_NOEXCEPT
```
**Description**
Copy constructor.
____________________________________________________________________________________________________
Tests
## Tests
```cpp
ETL_NODISCARD
ETL_CONSTEXPR14
bool ok() const
ETL_NOEXCEPT
Returns true if the weekday is valid
______________________________________________
```
**Return**
`true` if the weekday is valid
---
```cpp
ETL_NODISCARD
ETL_CONSTEXPR14
bool is_weekend() const
ETL_NOEXCEPT
Returns true if the weekday is a Saturday or Sunday.
____________________________________________________________________________________________________
Assignment
```
**Return**
`true` if the weekday is a Saturday or Sunday.
## Assignment
```cpp
ETL_CONSTEXPR14
etl::chrono::weekday& operator =(const etl::chrono::weekday& rhs)
ETL_NOEXCEPT
```
**Description**
Assignment operator
____________________________________________________________________________________________________
Access
## Access
```cpp
ETL_CONSTEXPR14
int c_encoding() const
ETL_NOEXCEPT
```
**Description**
Gets the value of the weekday using C encoding.
---
```cpp
ETL_CONSTEXPR14
int iso_encoding() const
ETL_NOEXCEPT
```
**Description**
Gets the value of the weekday using ISO encoding.
---
```cpp
ETL_NODISCARD
ETL_CONSTEXPR14
etl::chrono::weekday_indexed operator[](unsigned index) const
ETL_NOEXCEPT
```
**Description**
Index operator, from index.
---
```cpp
ETL_NODISCARD
ETL_CONSTEXPR14
etl::chrono::weekday_last operator[](etl::chrono::last_spec last) const
ETL_NOEXCEPT
Index operator, from etl::chrono::last_spec.
____________________________________________________________________________________________________
Increment/decrement
```
**Description**
Index operator, from `etl::chrono::last_spec`.
## Increment/decrement
```cpp
ETL_CONSTEXPR14
etl::chrono::weekday& operator ++()
ETL_NOEXCEPT
```
**Description**
Pre-increment operator.
______________________________________________
---
```cpp
ETL_CONSTEXPR14
etl::chrono::weekday operator ++(int)
ETL_NOEXCEPT
```
**Description**
Post-increment operator.
______________________________________________
---
```cpp
ETL_CONSTEXPR14
etl::chrono::weekday& operator --()
ETL_NOEXCEPT
```
**Description**
Pre-decrement operator.
______________________________________________
---
```cpp
ETL_CONSTEXPR14
etl::chrono::weekday operator --(int)
ETL_NOEXCEPT
```
**Description**
Post-decrement operator.
____________________________________________________________________________________________________
Mathematical operators
## Mathematical operators
```cpp
ETL_CONSTEXPR14
etl::chrono::weekday& operator +=(const etl::chrono::weekdays& ms)
ETL_NOEXCEPT
Plus-equals operator adding etl::chrono::weekdays.
______________________________________________
```
**Description**
Plus-equals operator adding `etl::chrono::weekdays`.
---
```cpp
ETL_CONSTEXPR14
etl::chrono::weekday& operator -=(const etl::chrono::weekdays& ms)
ETL_NOEXCEPT
Minus-equals operator subtracting etl::chrono::weekdays.
____________________________________________________________________________________________________
Constants
```
**Description**
Minus-equals operator subtracting `etl::chrono::weekdays`.
## Constants
```cpp
ETL_NODISCARD
static
ETL_CONSTEXPR14
etl::chrono::weekday min()
ETL_NOEXCEPT
The minimum weekday value for which ok() will return true.
______________________________________________
```
**Description**
The minimum weekday value for which `ok()` will return true.
---
```cpp
ETL_NODISCARD
static
ETL_CONSTEXPR14
etl::chrono::weekday max()
ETL_NOEXCEPT
The maximum weekday value for which ok() will return true.
____________________________________________________________________________________________________
Non-member mathematical operators
```
**Description**
The maximum weekday value for which `ok()` will return true.
## Non-member mathematical operators
```cpp
ETL_CONSTEXPR14
etl::chrono::weekday operator +(const etl::chrono::weekday& m,
const etl::chrono::weekdays& ms)
ETL_NOEXCEPT
Add etl::chrono::weekdays to etl::chrono::weekday.
Returns etl::chrono::weekday.
______________________________________________
```
**Description**
Add `etl::chrono::weekdays` to `etl::chrono::weekday`.
**Return**
`etl::chrono::weekday`.
---
```cpp
ETL_CONSTEXPR14
etl::chrono::weekday operator +(const etl::chrono::weekdays& ms,
const etl::chrono::weekday& m)
ETL_NOEXCEPT
Add etl::chrono::weekday to etl::chrono::weekdays.
Returns etl::chrono::weekday.
______________________________________________
```
**Description**
Add `etl::chrono::weekday` to `etl::chrono::weekdays`.
**Return**
`etl::chrono::weekday`.
---
```cpp
ETL_CONSTEXPR14
etl::chrono::weekday operator -(const etl::chrono::weekday& m,
const etl::chrono::weekdays& ms)
ETL_NOEXCEPT
Subtract etl::chrono::weekdays from etl::chrono::weekday.
Returns etl::chrono::weekday.
______________________________________________
```
**Description**
Subtract `etl::chrono::weekdays` from `etl::chrono::weekday`.
**Return**
`etl::chrono::weekday`.
---
```cpp
ETL_CONSTEXPR14
etl::chrono::weekday operator -(const etl::chrono::weekdays& ms,
const etl::chrono::weekday& m)
ETL_NOEXCEPT
Subtract etl::chrono::weekday from etl::chrono::weekdays.
Returns etl::chrono::weekdays.
______________________________________________
```
**Description**
Subtract `etl::chrono::weekday` from `etl::chrono::weekdays`.
**Return**
`etl::chrono::weekdays`.
---
```cpp
ETL_CONSTEXPR14
etl::chrono::weekdays operator -(const etl::chrono::weekday& m1,
const etl::chrono::weekday& m2) ETL_NOEXCEPT
Subtract etl::chrono::weekday from etl::chrono::weekday.
Returns etl::chrono::weekdays.
____________________________________________________________________________________________________
Non-member comparison operators
```
**Description**
Subtract `etl::chrono::weekday` from `etl::chrono::weekday`.
**Return**
`etl::chrono::weekdays`.
## Non-member comparison operators
```cpp
ETL_CONSTEXPR14
bool operator ==(const etl::chrono::weekday& m1,
const etl::chrono::weekday& m2)
ETL_NOEXCEPT
```
**Description**
Equality operator.
______________________________________________
---
```cpp
ETL_CONSTEXPR14
bool operator !=(const etl::chrono::weekday& m1,
const etl::chrono::weekday& m2)
ETL_NOEXCEPT
```
**Description**
Inequality operator.
______________________________________________
---
```cpp
ETL_CONSTEXPR14
bool operator <(const etl::chrono::weekday& m1,
const etl::chrono::weekday& m2)
ETL_NOEXCEPT
```
**Description**
Less-than operator.
______________________________________________
---
```cpp
ETL_CONSTEXPR14
bool operator <=(const etl::chrono::weekday& m1,
const etl::chrono::weekday& m2)
ETL_NOEXCEPT
```
**Description**
Less-than-or-equal operator.
______________________________________________
---
```cpp
ETL_CONSTEXPR14
bool operator >(const etl::chrono::weekday& m1,
const etl::chrono::weekday& m2)
ETL_NOEXCEPT
```
**Description**
Greater-than operator.
______________________________________________
---
```cpp
ETL_CONSTEXPR14
bool operator >=(const etl::chrono::weekday& m1,
const etl::chrono::weekday& m2)
ETL_NOEXCEPT
```
**Description**
Greater-than-or-equal operator.
______________________________________________
---
```cpp
[[nodiscard]] inline constexpr
auto operator <=>(const etl::chrono::weekday& m1,
const etl::chrono::weekday& m2)
noexcept
Spaceship operator.
```
**Description**
Spaceship operator.
C++20
____________________________________________________________________________________________________
Defined weekdays
## Defined weekdays
```cpp
etl::chrono::Monday
etl::chrono::Tuesday
etl::chrono::Wednesday
@ -220,10 +374,13 @@ etl::chrono::Thursday
etl::chrono::Friday
etl::chrono::Saturday
etl::chrono::Sunday
____________________________________________________________________________________________________
Hash
```
## Hash
```cpp
template <>
struct hash<etl::chrono::weekday>
Hash function for etl::chrono::weekday
```
**Description**
Hash function for `etl::chrono::weekday`.

View File

@ -0,0 +1,127 @@
---
title: "weekday_indexed"
---
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
Similar to: [std::chrono::weekday_indexed](https://en.cppreference.com/w/cpp/chrono/weekday_last.html)
{{< /callout >}}
A class representing an indexed weekday.
```cpp
class weekday_indexed
```
## Construction
```cpp
ETL_CONSTEXPR
weekday_indexed()
ETL_NOEXCEPT
```
**Description**
Default constructor.
---
```cpp
ETL_CONSTEXPR14
weekday_indexed(const etl::chrono::weekday& wd, unsigned index)
ETL_NOEXCEPT
```
**Description**
Construct from `weekday` and `index`.
---
```cpp
ETL_CONSTEXPR14
weekday_indexed(const etl::chrono::weekday_indexed& other)
ETL_NOEXCEPT
```
**Description**
Copy constructor.
## Tests
ETL_NODISCARD
ETL_CONSTEXPR14
bool ok() const
ETL_NOEXCEPT
**Return**
`true` if the weekday_indexed is valid
---
```cpp
ETL_NODISCARD
ETL_CONSTEXPR14
bool is_weekend() const
ETL_NOEXCEPT
```
**Return**
`true` if the `weekday_indexed` is a `Saturday` or `Sunday`.
## Assignment
```cpp
ETL_CONSTEXPR14
etl::chrono::weekday_indexed& operator =(const etl::chrono::weekday_indexed& rhs)
ETL_NOEXCEPT
```
**Description**
Assignment operator
## Access
```cpp
ETL_CONSTEXPR14
etl::chrono::weekday weekday() const
ETL_NOEXCEPT
```
**Description**
Gets the weekday.
---
```cpp
ETL_CONSTEXPR14
unsigned index() const
ETL_NOEXCEPT
```
**Description**
Gets the index.
## Non-member comparison operators
```cpp
ETL_CONSTEXPR14
bool operator ==(const etl::chrono::weekday_indexed& m1,
const etl::chrono::weekday_indexed& m2)
ETL_NOEXCEPT
```
**Description**
Equality operator.
---
```cpp
ETL_CONSTEXPR14
bool operator !=(const etl::chrono::weekday_indexed& m1,
const etl::chrono::weekday_indexed& m2)
ETL_NOEXCEPT
```
**Description**
Inequality operator.
## Hash
```cpp
template <>
struct hash<etl::chrono::weekday_indexed>
```
**Description**
Hash function for `etl::chrono::weekday_indexed`.

View File

@ -0,0 +1,107 @@
---
title: "weekday_last"
---
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
Similar to: [std::chrono::weekday_last](https://en.cppreference.com/w/cpp/chrono/weekday_last.html)
{{< /callout >}}
A class representing the last day of a weekday.
```cpp
class weekday_last
```
## Construction
```cpp
ETL_CONSTEXPR
weekday_last()
ETL_NOEXCEPT
```
**Description**
Default constructor.
---
```cpp
ETL_CONSTEXPR14
weekday_last(const etl::chrono::weekday& wd)
ETL_NOEXCEPT
```
**Description**
Construct from weekday and index.
---
```cpp
ETL_CONSTEXPR14
weekday_last(const etl::chrono::weekday_last& other)
ETL_NOEXCEPT
```
**Description**
Copy constructor.
---
## Tests
```cpp
ETL_NODISCARD
ETL_CONSTEXPR14
bool ok() const
ETL_NOEXCEPT
```
**Return**
`true` if the weekday_last valid.
## Assignment
```cpp
ETL_CONSTEXPR14
etl::chrono::weekday_last& operator =(const etl::chrono::weekday_last& rhs)
ETL_NOEXCEPT
```
**Description**
Assignment operator
## Access
```cpp
ETL_CONSTEXPR14
etl::chrono::weekday weekday() const
ETL_NOEXCEPT
```
**Description**
Gets the weekday.
## Non-member comparison operators
```cpp
ETL_CONSTEXPR14
bool operator ==(const etl::chrono::weekday_last& m1,
const etl::chrono::weekday_last& m2)
ETL_NOEXCEPT
```
**Description**
Equality operator.
---
ETL_CONSTEXPR14
bool operator !=(const etl::chrono::weekday_last& m1,
const etl::chrono::weekday_last& m2)
ETL_NOEXCEPT
**Description**
Inequality operator.
## Hash
```cpp
template <>
struct hash<etl::chrono::weekday_last>
```
**Description**
Hash function for `etl::chrono::weekday_last`.

View File

@ -1,5 +1,5 @@
---
title: "Year"
title: "Years"
weight: 100
---

View File

@ -1,164 +1,251 @@
year_month_day_last
A class representing a year and month.
Back to chrono
____________________________________________________________________________________________________
year_month_day_last
---
title: "year_month_day_last"
---
STL equivalent: std::chrono::year_month_day_last
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
Similar to: [std::chrono::year_month_day_last](https://en.cppreference.com/w/cpp/chrono/year_month_day_last.html)
{{< /callout >}}
A class representing a year, month and last day.
```cpp
class year_month_day_last
____________________________________________________________________________________________________
Construction
```
## Construction
```cpp
ETL_CONSTEXPR year_month_day_last()
```
**Description**
Default constructor.
______________________________________________
---
```cpp
ETL_CONSTEXPR14
year_month_day(const etl::chrono::year& y,
const etl::chrono::month_day_last& mdl)
ETL_NOEXCEPT
```
**Description**
Construct from month and day.
______________________________________________
---
```cpp
ETL_CONSTEXPR14
year_month_day(const etl::chrono::year_month_day_last& ymdl)
ETL_NOEXCEPT
Construct from year_month_day_last.
____________________________________________________________________________________________________
Access
```
**Description**
Construct from `year_month_day_last`.
## Access
```cpp
ETL_NODISCARD
ETL_CONSTEXPR14
etl::chrono::year year() const
ETL_NOEXCEPT
Returns the year.
______________________________________________
```
**Return**
The year.
---
```coo
ETL_NODISCARD
ETL_CONSTEXPR14
etl::chrono::month month() const
ETL_NOEXCEPT
Returns the month.
______________________________________________
```
**Return**
The month.
---
```cpp
ETL_NODISCARD
ETL_CONSTEXPR14
etl::chrono::month_day_last month_day_last() const
ETL_NOEXCEPT
Returns the month.
____________________________________________________________________________________________________
Tests
```
**Returns**
The month.
## Tests
```cpp
ETL_NODISCARD
ETL_CONSTEXPR14
bool ok() const
ETL_NOEXCEPT
Returns true if the year and month is within the valid limits.
______________________________________________
```
**Return**
`true` if the year and month is within the valid limits.
---
```cpp
ETL_NODISCARD
ETL_CONSTEXPR14
int compare(const etl::chrono::year_month_day_last& other) const
ETL_NOEXCEPT
Compare year_month_day with another.
if year < other.year, returns -1
else if year > other.year, returns 1
if month < other.month, returns -1
else if month > other.month, returns 1
else returns 0
____________________________________________________________________________________________________
operators
```
**Description**
Compare `year_month_day` with another.
if `year < other.year`, returns `-1`
else if `year > other.year`, returns `1`
if `month < other.month`, returns `-1`
else if `month > other.month`, returns `1`
else returns `0`
## operators
```cpp
ETL_CONSTEXPR14
etl::chrono::year_month_day_last& operator +=(const etl::chrono::years& dy)
ETL_NOEXCEPT
Adds etl::chrono::years.
```
Adds `etl::chrono::years`.
---
```cpp
ETL_CONSTEXPR14
etl::chrono::year_month_day_last& operator +=(const etl::chrono::months& dm)
ETL_NOEXCEPT
Adds etl::chrono::months.
```
**Description**
Adds `etl::chrono::months`.
---
```cpp
ETL_CONSTEXPR14
etl::chrono::year_month_day_last& operator -=(const etl::chrono::years& dy)
ETL_NOEXCEPT
Subtracts etl::chrono::years.
```
**Description**
Subtracts `etl::chrono::years`.
---
```cpp
ETL_CONSTEXPR14
etl::chrono::year_month_day_last& operator -=(const etl::chrono::months& dm)
ETL_NOEXCEPT
Subtracts etl::chrono::months.
____________________________________________________________________________________________________
Non-member operators
```
**Description**
Subtracts `etl::chrono::months`.
## Non-member operators
```cpp
ETL_CONSTEXPR14
etl::chrono::year_month_day_last operator +(const etl::chrono::year_month_day_last& ym,
const etl::chrono::years& dy)
Adds etl::chrono::years.
______________________________________________
```
**Description**
Adds `etl::chrono::years`.
---
```cpp
ETL_CONSTEXPR14
etl::chrono::year_month_day_last operator +(const etl::chrono::years& dy,
const etl::chrono::year_month_day_last& ym)
ETL_NOEXCEPT
Adds etl::chrono::years.
______________________________________________
```
**Description**
Adds `etl::chrono::years`.
---
```cpp
ETL_CONSTEXPR14
etl::chrono::year_month_day_last operator +(const etl::chrono::year_month_day_last& ym,
const etl::chrono::months& dm)
ETL_NOEXCEPT
Adds etl::chrono::months.
______________________________________________
```
**Description**
Adds `etl::chrono::months`.
---
```cpp
ETL_CONSTEXPR14
etl::chrono::year_month_day_last operator +(const etl::chrono::months& dm,
const etl::chrono::year_month_day_last& ym)
ETL_NOEXCEPT
Adds etl::chrono::months.
______________________________________________
```
**Description**
Adds `etl::chrono::months`.
---
```cpp
ETL_CONSTEXPR14
etl::chrono::year_month_last operator -(const etl::chrono::year_month_day_last& ym,
const etl::chrono::years& dy)
ETL_NOEXCEPT
Subtracts etl::chrono::years.
______________________________________________
```
**Description**
Subtracts `etl::chrono::years`.
---
```cpp
ETL_CONSTEXPR14
etl::chrono::year_month_day_last operator -(const etl::chrono::year_month_day& ym,
const etl::chrono::months& dm)
ETL_NOEXCEPT
Subtracts etl::chrono::months.
___________________________________________________________________________________________________
Non-member comparison operators
```
**Description**
Subtracts `etl::chrono::months`.
## Non-member comparison operators
```cpp
ETL_CONSTEXPR14
bool operator ==(const etl::chrono::year_month_day_last& lhs,
const etl::chrono::year_month_day_last& rhs)
ETL_NOEXCEPT
```
**Description**
Equality operator.
______________________________________________
---
```cpp
ETL_CONSTEXPR14
bool operator !=(const etl::chrono::year_month_day_last& lhs,
const etl::chrono::year_month_day_last& rhs)
ETL_NOEXCEPT
```
**Description**
Inequality operator.
______________________________________________
---
```cpp
[[nodiscard]] friend constexpr
auto operator <=>(const etl::chrono::year_month_day& lhs,
const etl::chrono::year_month_day& rhs)
ETL_NOEXCEPT
Spaceship operator
______________________________________________
ETL_CONSTEXPR14
int compare(const year_month& other) const
ETL_NOEXCEPT
Compare year_month_day with another.
if year < other.year, returns -1
else if year > other.year, returns 1
if month < other.month, returns -1
else if month > other.month, returns 1
else if day < other.day, returns -1
else if day > other.day, returns 1
else returns 0
____________________________________________________________________________________________________
Hash
```
**Description**
Spaceship operator.
C++20
## Hash
```cpp
template <>
struct hash<etl::chrono::year_month_day_last>
Hash function for etl::chrono::year_month_day_last
```
**Description**
Hash function for `etl::chrono::year_month_day_last`.

View File

@ -1,94 +0,0 @@
month_weekday
A class representing a month and weekday.
Back to chrono
____________________________________________________________________________________________________
month_weekday
STL equivalent: std::chrono::month_weekday
class month_weekday
____________________________________________________________________________________________________
Construction
ETL_CONSTEXPR
month_weekday()
Default constructor.
______________________________________________
ETL_CONSTEXPR14
month_weekday(const etl::chrono::month& m,
const etl::chrono::weekday_indexed& wd)
ETL_NOEXCEPT
Construct from month and weekday_indexed.
____________________________________________________________________________________________________
Access
ETL_NODISCARD
ETL_CONSTEXPR14
etl::chrono::month month() const
ETL_NOEXCEPT
Returns the month.
______________________________________________
ETL_NODISCARD
ETL_CONSTEXPR14
etl::chrono::weekday_indexed weekday_indexed() const
ETL_NOEXCEPT
Returns the weekday.
____________________________________________________________________________________________________
Tests
ETL_NODISCARD
ETL_CONSTEXPR14
bool ok() const
ETL_NOEXCEPT
Returns true if the month and day is within the valid limits.
____________________________________________________________________________________________________
Non-member comparison operators
ETL_CONSTEXPR14
bool operator ==(const etl::chrono::month_weekday& lhs,
const etl::chrono::month_weekday& rhs)
ETL_NOEXCEPT
Equality operator.
______________________________________________
ETL_CONSTEXPR14
bool operator !=(const etl::chrono::month_weekday& lhs,
const etl::chrono::month_weekday& rhs)
ETL_NOEXCEPT
Inequality operator.
______________________________________________
ETL_CONSTEXPR14
bool operator <(const etl::chrono::month_weekday& lhs,
const etl::chrono::month_weekday& rhs)
ETL_NOEXCEPT
Less-than operator.
______________________________________________
ETL_CONSTEXPR14
bool operator <=(const etl::chrono::month_weekday& lhs,
const etl::chrono::month_weekday& rhs)
ETL_NOEXCEPT
Less-than-equal operator.
______________________________________________
ETL_CONSTEXPR14
bool operator <(const etl::chrono::month_weekday& lhs,
const etl::chrono::month_weekday& rhs)
ETL_NOEXCEPT
Greater-than operator.
______________________________________________
ETL_CONSTEXPR14
bool operator <=(const etl::chrono::month_weekday& lhs,
const etl::chrono::month_weekday& rhs)
ETL_NOEXCEPT
Greater-than-equal operator.
______________________________________________
[[nodiscard]] constexpr
auto operator <=>(const etl::chrono::month_weekday& lhs,
const etl::chrono::month_weekday& rhs)
ETL_NOEXCEPT
Spaceship operator
____________________________________________________________________________________________________
Hash
template <typename TRep, typename TPeriod>
struct hash<etl::chrono::month_weekday>
Hash function for etl::chrono::month_weekday

View File

@ -1,80 +0,0 @@
weekday_indexed
A class representing a weekday_indexed.
Back to chrono
____________________________________________________________________________________________________
weekday_indexed
STL equivalent: std::chrono::weekday_indexed
class weekday_indexed
____________________________________________________________________________________________________
Construction
ETL_CONSTEXPR
weekday_indexed()
ETL_NOEXCEPT
Default constructor.
______________________________________________
ETL_CONSTEXPR14
weekday_indexed(const etl::chrono::weekday& wd, unsigned index)
ETL_NOEXCEPT
Construct from weekday and index.
______________________________________________
ETL_CONSTEXPR14
weekday_indexed(const etl::chrono::weekday_indexed& other)
ETL_NOEXCEPT
Copy constructor.
____________________________________________________________________________________________________
Tests
ETL_NODISCARD
ETL_CONSTEXPR14
bool ok() const
ETL_NOEXCEPT
Returns true if the weekday_indexed is valid
______________________________________________
ETL_NODISCARD
ETL_CONSTEXPR14
bool is_weekend() const
ETL_NOEXCEPT
Returns true if the weekday_indexed is a Saturday or Sunday.
____________________________________________________________________________________________________
Assignment
ETL_CONSTEXPR14
etl::chrono::weekday_indexed& operator =(const etl::chrono::weekday_indexed& rhs)
ETL_NOEXCEPT
Assignment operator
____________________________________________________________________________________________________
Access
ETL_CONSTEXPR14
etl::chrono::weekday weekday() const
ETL_NOEXCEPT
Gets the weekday.
______________________________________________
ETL_CONSTEXPR14
unsigned index() const
ETL_NOEXCEPT
Gets the index.
____________________________________________________________________________________________________
Non-member comparison operators
ETL_CONSTEXPR14
bool operator ==(const etl::chrono::weekday_indexed& m1,
const etl::chrono::weekday_indexed& m2)
ETL_NOEXCEPT
Equality operator.
______________________________________________
ETL_CONSTEXPR14
bool operator !=(const etl::chrono::weekday_indexed& m1,
const etl::chrono::weekday_indexed& m2)
ETL_NOEXCEPT
Inequality operator.
____________________________________________________________________________________________________
Hash
template <>
struct hash<etl::chrono::weekday_indexed>
Hash function for etl::chrono::weekday_indexed

View File

@ -1,70 +0,0 @@
weekday_last
A class representing a weekday_last.
Back to chrono
____________________________________________________________________________________________________
weekday_last
STL equivalent: std::chrono::weekday_last
class weekday_last
____________________________________________________________________________________________________
Construction
ETL_CONSTEXPR
weekday_last()
ETL_NOEXCEPT
Default constructor.
______________________________________________
ETL_CONSTEXPR14
weekday_last(const etl::chrono::weekday& wd)
ETL_NOEXCEPT
Construct from weekday and index.
______________________________________________
ETL_CONSTEXPR14
weekday_last(const etl::chrono::weekday_last& other)
ETL_NOEXCEPT
Copy constructor.
____________________________________________________________________________________________________
Tests
ETL_NODISCARD
ETL_CONSTEXPR14
bool ok() const
ETL_NOEXCEPT
Returns true if the weekday_last valid.
____________________________________________________________________________________________________
Assignment
ETL_CONSTEXPR14
etl::chrono::weekday_last& operator =(const etl::chrono::weekday_last& rhs)
ETL_NOEXCEPT
Assignment operator
____________________________________________________________________________________________________
Access
ETL_CONSTEXPR14
etl::chrono::weekday weekday() const
ETL_NOEXCEPT
Gets the weekday.
____________________________________________________________________________________________________
Non-member comparison operators
ETL_CONSTEXPR14
bool operator ==(const etl::chrono::weekday_last& m1,
const etl::chrono::weekday_last& m2)
ETL_NOEXCEPT
Equality operator.
______________________________________________
ETL_CONSTEXPR14
bool operator !=(const etl::chrono::weekday_last& m1,
const etl::chrono::weekday_last& m2)
ETL_NOEXCEPT
Inequality operator.
____________________________________________________________________________________________________
Hash
template <>
struct hash<etl::chrono::weekday_last>
Hash function for etl::chrono::weekday_last