mirror of
https://github.com/ETLCPP/etl.git
synced 2026-04-30 19:09:10 +08:00
Added more documentation for chrono classes
Updated callouts
This commit is contained in:
parent
69d05198ec
commit
09af946a8f
@ -4,7 +4,7 @@ title: "bip_buffer_spsc_atomic"
|
||||
|
||||
{{< callout >}}
|
||||
Header: `bip_buffer_spsc_atomic.h`
|
||||
Supported: tbc
|
||||
Since: tbc
|
||||
{{< /callout >}}
|
||||
|
||||
A fixed capacity bipartite buffer.
|
||||
|
||||
@ -4,7 +4,7 @@ title: "buffer_descriptors"
|
||||
|
||||
{{< callout >}}
|
||||
Header: `buffer_descriptors.h`
|
||||
Supported: All versions
|
||||
Since: All versions
|
||||
{{< /callout >}}
|
||||
|
||||
A set of descriptors to a collection of buffers.
|
||||
|
||||
@ -4,7 +4,7 @@ title: "debounce"
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `debounce.h`
|
||||
Supported: `TBC`
|
||||
Since: `TBC`
|
||||
{{< /callout >}}
|
||||
|
||||
A class to debounce signals.
|
||||
|
||||
@ -4,7 +4,7 @@ title: "io_port"
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `io_port.h`
|
||||
Supported: `20.39.0`
|
||||
Since: `20.39.0`
|
||||
{{< /callout >}}
|
||||
|
||||
A set of templates for building interface classes to memory mapped hardware ports.
|
||||
|
||||
@ -4,7 +4,7 @@ title: "delegate"
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `delegate.h`
|
||||
Supported: `TBC`
|
||||
Since: `TBC`
|
||||
Similar to: [std::function_ref](https://en.cppreference.com/w/cpp/utility/functional/function_ref.html)
|
||||
{{< /callout >}}
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ title: "delegate_observable"
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `delegate_observable.h`
|
||||
Supported: `TBC`
|
||||
Since: `TBC`
|
||||
{{< /callout >}}
|
||||
|
||||
`etl::delegate_observable` is a variation on the observer pattern idea, but using delegates as the callback mechanism.
|
||||
|
||||
@ -8,7 +8,7 @@ title: "function"
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `function.h`
|
||||
Supported: `TBC`
|
||||
Since: `TBC`
|
||||
{{< /callout >}}
|
||||
|
||||
A set of wrapper templates to allow a member or static function to be called without the caller having to know the specific details of the callee apart from the parameter type. The templates allow the called function to be abstracted.
|
||||
|
||||
@ -5,7 +5,7 @@ weight: 1
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `inplace_function.h`
|
||||
Supported: `20.45.0`
|
||||
Since: `20.45.0`
|
||||
Similar to: [std::function](https://en.cppreference.com/w/cpp/utility/functional/function.html)
|
||||
{{< /callout >}}
|
||||
|
||||
|
||||
@ -2,3 +2,9 @@
|
||||
title: "Chrono"
|
||||
weight: 100
|
||||
---
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `chrono.h`
|
||||
Since: `20.41.0`
|
||||
Similar to: [std::chrono](https://en.cppreference.com/w/cpp/chrono.html)
|
||||
{{< /callout >}}
|
||||
@ -2,7 +2,13 @@
|
||||
title: "Chrono literals"
|
||||
---
|
||||
|
||||
The ETL Chrono literals are define slightly differently from the STL in that they are user defined, as opposed to language defined.
|
||||
{{< callout type="info">}}
|
||||
Header: `chrono.h`
|
||||
Since: `20.41.0`
|
||||
Similar to: [std::literals::chrono_literals](https://en.cppreference.com/w/cpp/chrono.html#Literals)
|
||||
{{< /callout >}}
|
||||
|
||||
The ETL Chrono literals are define slightly differently from the STL in that they are *user* defined, as opposed to *language* defined.
|
||||
|
||||
**Example**
|
||||
For STL, the literal to define year `2025` would be `2025y`.
|
||||
@ -23,7 +29,7 @@ If enabled, the example of `2025_y` would be written as `2025_year`.
|
||||
| `etl::chrono::microseconds` | `500_us` | `500_microseconds` |
|
||||
| `etl::chrono::nanoseconds` | `500_ns` | `500_nanoseconds` |
|
||||
|
||||
Chrono literals may by accessed by using one of the following:-
|
||||
Chrono literals may by accessed by using one of the following namespaces.
|
||||
|
||||
```cpp
|
||||
using namespace etl::chrono;
|
||||
|
||||
@ -4,7 +4,7 @@ title: "day"
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `chrono.h`
|
||||
Supported: `TBC`
|
||||
Since: `TBC`
|
||||
Similar to: [std::chrono::day](https://en.cppreference.com/w/cpp/chrono/day.html)
|
||||
{{< /callout >}}
|
||||
|
||||
|
||||
16
docs/chrono/duration/_index.md
Normal file
16
docs/chrono/duration/_index.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "Duration"
|
||||
weight: 100
|
||||
---
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `chrono.h`
|
||||
Since: `20.41.0`
|
||||
Similar to: [std::chrono](https://en.cppreference.com/w/cpp/chrono.html)
|
||||
{{< /callout >}}
|
||||
|
||||
Classes that represent a duration.
|
||||
|
||||
`etl::chrono::duration`
|
||||
`etl::chrono::duration_cast`
|
||||
`etl::chrono::duration_values`
|
||||
@ -4,7 +4,7 @@ title: "duration"
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `chrono.h`
|
||||
Supported: `TBC`
|
||||
Since: `TBC`
|
||||
Similar to: [std::chrono::duration](https://en.cppreference.com/w/cpp/chrono/duration.html)
|
||||
Similar to: [std::chrono::duration_values](https://en.cppreference.com/w/cpp/chrono/duration_values.html)
|
||||
{{< /callout >}}
|
||||
@ -48,7 +48,7 @@ using rep = TRep
|
||||
using period = typename TPeriod::type;
|
||||
```
|
||||
|
||||
## Construction
|
||||
### Construction
|
||||
```cpp
|
||||
ETL_CONSTEXPR
|
||||
duration()
|
||||
@ -85,7 +85,7 @@ ETL_NOEXCEPT
|
||||
Construct from another duration type.
|
||||
Enabled if `etl::ratio_divide<TPeriod2, TPeriod>::den == 1`
|
||||
|
||||
## Tests
|
||||
### Tests
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
@ -98,7 +98,7 @@ if `time_point < other`, returns `-1`
|
||||
else if `time_point > other`, returns `1`
|
||||
else returns `0`
|
||||
|
||||
## Assignment
|
||||
### Assignment
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::duration<TRep, TPeriod> operator =(const etl::chrono::duration<TRep, TPeriod>& other) ETL_NOEXCEPT
|
||||
@ -112,7 +112,7 @@ ETL_CONSTEXPR14
|
||||
etl::chrono::duration<TRep, TPeriod> operator =(const etl::chrono::duration<TRep2, TPeriod2>& other) ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
## Convertion
|
||||
### Convertion
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
TRep count() const
|
||||
@ -154,7 +154,7 @@ The absolute value of the duration.
|
||||
|
||||
---
|
||||
|
||||
## Constants
|
||||
### Constants
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
static ETL_CONSTEXPR14 etl::chrono::duration<TRep, TPeriod> zero()
|
||||
@ -221,7 +221,7 @@ ETL_NOEXCEPT
|
||||
**Description**
|
||||
Post-decrements the duration count.
|
||||
|
||||
## Mathematical operators
|
||||
### Mathematical operators
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
duration& operator +=(const duration<TRep, TPeriod>& d)
|
||||
@ -279,7 +279,7 @@ ETL_NOEXCEPT
|
||||
**Description**
|
||||
Sets this duration to the modulus of duration `d`.
|
||||
|
||||
## Comparison
|
||||
### Comparison
|
||||
```cpp
|
||||
template <typename TRep2, typename TPeriod2>
|
||||
ETL_CONSTEXPR14
|
||||
@ -292,7 +292,7 @@ If `duration < other`, returns `-1`
|
||||
else if `duration > other`, returns `1`
|
||||
else returns `0`
|
||||
|
||||
## Non-member mathematical operators
|
||||
### Non-member mathematical operators
|
||||
```cpp
|
||||
template <typename TRep1, typename TPeriod1, typename TRep2, typename TPeriod2>
|
||||
ETL_CONSTEXPR14
|
||||
@ -400,7 +400,7 @@ ETL_NOEXCEPT
|
||||
**Description**
|
||||
Operator `%`
|
||||
|
||||
## Non-member comparison operators
|
||||
### Non-member comparison operators
|
||||
```cpp
|
||||
template <typename TRep1, typename TPeriod1, typename TRep2, typename TPeriod2>
|
||||
ETL_CONSTEXPR14
|
||||
21
docs/chrono/duration/duration_cast.md
Normal file
21
docs/chrono/duration/duration_cast.md
Normal file
@ -0,0 +1,21 @@
|
||||
---
|
||||
title: "duration_cast"
|
||||
---
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `chrono.h`
|
||||
Since: `20.41.0`
|
||||
Similar to: [std::chrono::duration_cast](https://en.cppreference.com/w/cpp/chrono/duration/duration_cast.html)
|
||||
{{< /callout >}}
|
||||
|
||||
Templates representing a time interval.
|
||||
|
||||
## duration_cast
|
||||
```cpp
|
||||
template <typename TToDuration, typename TRep, typename TPeriod>
|
||||
ETL_CONSTEXPR14
|
||||
TToDuration duration_cast(const etl::chrono::duration<TRep, TPeriod>& d)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Converts from one duration type to another.
|
||||
38
docs/chrono/duration/duration_values.md
Normal file
38
docs/chrono/duration/duration_values.md
Normal file
@ -0,0 +1,38 @@
|
||||
---
|
||||
title: "duration_values"
|
||||
---
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `chrono.h`
|
||||
Since: `20.41.0`
|
||||
Similar to: [std::chrono::duration_values](https://en.cppreference.com/w/cpp/chrono/duration_values.html)
|
||||
{{< /callout >}}
|
||||
|
||||
Templates representing a time interval.
|
||||
|
||||
## duration_values
|
||||
```cpp
|
||||
template <typename TRep>
|
||||
struct duration_values
|
||||
```
|
||||
```cpp
|
||||
ETL_NODISCARD static ETL_CONSTEXPR TRep zero() ETL_NOEXCEPT
|
||||
```
|
||||
**Return**
|
||||
`TRep(0)`
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_NODISCARD static ETL_CONSTEXPR14 TRep min() ETL_NOEXCEPT
|
||||
```
|
||||
**Return**
|
||||
`etl::numeric_limits<TRep>::min()`
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_NODISCARD static ETL_CONSTEXPR14 TRep max() ETL_NOEXCEPT
|
||||
```
|
||||
**Returns**
|
||||
`etl::numeric_limits<TRep>::max()`
|
||||
138
docs/chrono/hh_mm_ss.md
Normal file
138
docs/chrono/hh_mm_ss.md
Normal file
@ -0,0 +1,138 @@
|
||||
---
|
||||
title: "hh_mm_ss"
|
||||
---
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `chrono.h`
|
||||
Since: `20.41.0`
|
||||
Similar to: [std::chrono::hh_mm_ss](https://en.cppreference.com/w/cpp/chrono/hh_mm_ss.html)
|
||||
{{< /callout >}}
|
||||
|
||||
A type to hold hours, minutes, and seconds.
|
||||
|
||||
```cpp
|
||||
template <typename TDuration>
|
||||
class hh_mm_ss
|
||||
```
|
||||
**Description**
|
||||
Static asserts if `TDuration` is not a specialisation of `etl::chrono::duration`.
|
||||
|
||||
|
||||
## Constants
|
||||
```cpp
|
||||
static constexpr int fractional_width;
|
||||
```
|
||||
**Description**
|
||||
The number of fractional digits.
|
||||
|
||||
## Member types
|
||||
```cpp
|
||||
precision
|
||||
```
|
||||
**Description**
|
||||
The return type for `to_duration`.
|
||||
|
||||
## Constructors
|
||||
```cpp
|
||||
ETL_CONSTEXPR
|
||||
hh_mm_ss()
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Default constructor.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
explicit hh_mm_ss(TDuration d)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Construct from `duration`.
|
||||
|
||||
## Access
|
||||
```pp
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
bool is_negative() const
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Checks for negative duration.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::hours hours() const
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Return**
|
||||
The hours.
|
||||
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::minutes minutes() const
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Return**
|
||||
The minutes.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::seconds seconds() const
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Return**
|
||||
The seconds.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
precision subseconds() const
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Return**
|
||||
The subseconds.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
explicit operator precision() const
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Return**
|
||||
The duration.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
precision to_duration() const
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Return***
|
||||
The duration.
|
||||
|
||||
## absolute
|
||||
```cpp
|
||||
template <typename TDuration>
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
TDuration absolute(TDuration dur)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
A specialisation of absolute for `etl::chrono::duration`.
|
||||
**Return**
|
||||
The absolute duration value.
|
||||
25
docs/chrono/last_spec.md
Normal file
25
docs/chrono/last_spec.md
Normal file
@ -0,0 +1,25 @@
|
||||
---
|
||||
title: "last_spec"
|
||||
---
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `chrono.h`
|
||||
Since: `20.41.0`
|
||||
Similar to: [std::chrono::last_spec](https://en.cppreference.com/w/cpp/chrono/last_spec.html)
|
||||
{{< /callout >}}
|
||||
|
||||
`last_spec` is a tag type that is used in conjunction with other calendar types to indicate the last thing in a sequence.
|
||||
|
||||
```cpp
|
||||
struct last_spec
|
||||
{
|
||||
explicit last_spec() = default;
|
||||
};
|
||||
|
||||
inline constexpr last_spec last{};
|
||||
```
|
||||
|
||||
**Example**
|
||||
|
||||
`2025_y/March/last` for last day of March 2025 i.e. 2025-03-31
|
||||
|
||||
18
docs/chrono/month/_index.md
Normal file
18
docs/chrono/month/_index.md
Normal file
@ -0,0 +1,18 @@
|
||||
---
|
||||
title: "Month"
|
||||
weight: 100
|
||||
---
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `chrono.h`
|
||||
Since: `20.41.0`
|
||||
Similar to: [std::chrono](https://en.cppreference.com/w/cpp/chrono.html)
|
||||
{{< /callout >}}
|
||||
|
||||
Classes that represent months.
|
||||
|
||||
`etl::chrono::month`
|
||||
`etl::chrono::month_day`
|
||||
`etl::chrono::month_day_last`
|
||||
`etl::chrono::month_weekday`
|
||||
`etl::chrono::month_weekday_last`
|
||||
@ -1,224 +1,329 @@
|
||||
Operators
|
||||
---
|
||||
title: "operators"
|
||||
---
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `chrono.h`
|
||||
Since: `20.41.0`
|
||||
Similar to: [std::chrono::operator /](https://en.cppreference.com/w/cpp/chrono/operator_slash.html)
|
||||
{{< /callout >}}
|
||||
|
||||
Operators for building dates.
|
||||
Back to chrono
|
||||
____________________________________________________________________________________________________
|
||||
month_day
|
||||
|
||||
## month_day
|
||||
|
||||
Create from month and day.
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month_day operator /(const etl::chrono::month& m,
|
||||
const etl::chrono::day& d)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month_day operator /(const etl::chrono::month& m,
|
||||
int d)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month_day operator /(int m,
|
||||
const etl::chrono::day& d)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month_day operator /(const etl::chrono::day& d,
|
||||
const etl::chrono::month& m)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month_day operator /(const etl::chrono::day& d,
|
||||
int m)
|
||||
ETL_NOEXCEPT
|
||||
____________________________________________________________________________________________________
|
||||
month_day_last
|
||||
```
|
||||
|
||||
## month_day_last
|
||||
|
||||
Create from month and last_spec.
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month_day_last operator /(const etl::chrono::month& m,
|
||||
etl::chrono::last_spec)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month_day_last operator /(int m,
|
||||
etl::chrono::last_spec)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month_day_last operator /(etl::chrono::last_spec,
|
||||
const etl::chrono::month& m)
|
||||
ETL_NOEXCEPT
|
||||
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month_day_last operator /(etl::chrono::last_spec,
|
||||
int m)
|
||||
ETL_NOEXCEPT
|
||||
____________________________________________________________________________________________________
|
||||
month_weekday
|
||||
```
|
||||
|
||||
## month_weekday
|
||||
|
||||
Create from month and weekday.
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month_weekday operator /(const etl::chrono::month& m,
|
||||
const etl::chrono::weekday_indexed& wdi)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month_weekday operator /(int m,
|
||||
const etl::chrono::weekday_indexed& wdi)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month_weekday operator /(const etl::chrono::weekday_indexed& wdi,
|
||||
const etl::chrono::month& m)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month_weekday operator /(const etl::chrono::weekday_indexed& wdi,
|
||||
int m)
|
||||
ETL_NOEXCEPT
|
||||
____________________________________________________________________________________________________
|
||||
month_weekday_last
|
||||
```
|
||||
|
||||
## month_weekday_last
|
||||
|
||||
Create from month and weekday_last.
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month_weekday_last operator /(const etl::chrono::month& m,
|
||||
const etl::chrono::weekday_last& wdl)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month_weekday_last operator /(int m,
|
||||
const etl::chrono::weekday_last& wdl)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month_weekday_last operator /(const etl::chrono::weekday_last& wdl,
|
||||
const etl::chrono::month& m)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month_weekday_last operator /(const etl::chrono::weekday_last& wdl,
|
||||
int m)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
____________________________________________________________________________________________________
|
||||
year_month
|
||||
## year_month
|
||||
|
||||
Create from year and month.
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month operator /(const etl::chrono::year& y,
|
||||
const etl::chrono::month& m)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month operator /(const etl::chrono::year& y,
|
||||
int m)
|
||||
ETL_NOEXCEPT
|
||||
____________________________________________________________________________________________________
|
||||
year_month_day
|
||||
```
|
||||
|
||||
## year_month_day
|
||||
|
||||
Create from year, month, and day.
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14 etl::chrono::year_month_day operator /(const etl::chrono::year_month& ym,
|
||||
const etl::chrono::day& d)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14 etl::chrono::year_month_day operator /(const etl::chrono::year_month& ym,
|
||||
int d )
|
||||
ETL_NOEXCEPT
|
||||
____________________________________________________________________________________________________
|
||||
year_month_day
|
||||
```
|
||||
|
||||
## year_month_day
|
||||
|
||||
Create from year and month_day.
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_day operator /(const etl::chrono::year& y,
|
||||
const etl::chrono::month_day& md)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_day operator /(int y,
|
||||
const etl::chrono::month_day& md)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_day operator /(const etl::chrono::month_day& md,
|
||||
const etl::chrono::year& y)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_day operator /(const etl::chrono::month_day& md,
|
||||
int y)
|
||||
ETL_NOEXCEPT
|
||||
____________________________________________________________________________________________________
|
||||
year_month_day_last
|
||||
```
|
||||
|
||||
## year_month_day_last
|
||||
|
||||
Create from year_month and last_spec.
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_day_last operator /(const etl::chrono::year_month& ym,
|
||||
etl::chrono::last_spec)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_day_last operator /(const etl::chrono::year& y,
|
||||
const etl::chrono::month_day_last& mdl)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_day_last operator /(int y,
|
||||
const etl::chrono::month_day_last& mdl)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_day_last operator /(const etl::chrono::month_day_last& mdl,
|
||||
const etl::chrono::year& y)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_day_last operator /(const etl::chrono::month_day_last& mdl,
|
||||
int y)
|
||||
ETL_NOEXCEPT
|
||||
____________________________________________________________________________________________________
|
||||
year_month_weekday
|
||||
```
|
||||
|
||||
## year_month_weekday
|
||||
|
||||
Create from year_month and weekday.
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_weekday operator /(const etl::chrono::year_month& ym,
|
||||
const etl::chrono::weekday_indexed& wdi)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_weekday operator /(const etl::chrono::year& y,
|
||||
const etl::chrono::month_weekday& mwd)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_weekday operator /(int y,
|
||||
const etl::chrono::month_weekday& mwd)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_weekday operator /(const etl::chrono::month_weekday& mwd,
|
||||
const etl::chrono::year& y)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_weekday operator /(const etl::chrono::month_weekday& mwd,
|
||||
int y)
|
||||
ETL_NOEXCEPT
|
||||
____________________________________________________________________________________________________
|
||||
year_month_weekday_last
|
||||
```
|
||||
|
||||
## year_month_weekday_last
|
||||
|
||||
Create from year_month and weekday_last.
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_weekday_last operator /(const etl::chrono::year_month& ym,
|
||||
const etl::chrono::weekday_last& wdl)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_weekday_last operator /(const etl::chrono::year& y,
|
||||
const etl::chrono::month_weekday_last& mwdl)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_weekday_last operator /(int y,
|
||||
const etl::chrono::month_weekday_last& mwdl)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_weekday_last operator /(const etl::chrono::month_weekday_last& mwdl,
|
||||
const etl::chrono::year& y)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_weekday_last operator /(const etl::chrono::month_weekday_last& mwdl,
|
||||
int y)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
@ -1,182 +1,273 @@
|
||||
time_point
|
||||
etl::chrono::time_point represents a point in time.
|
||||
Back to chrono
|
||||
____________________________________________________________________________________________________
|
||||
tme_point
|
||||
---
|
||||
title: "time_point"
|
||||
---
|
||||
|
||||
Represents a point in time storing a TDuration indicating the time
|
||||
interval from the start of the TClock's epoch.
|
||||
{{< callout type="info">}}
|
||||
Header: `chrono.h`
|
||||
Since: `20.41.0`
|
||||
Similar to: [std::chrono::time_point](https://en.cppreference.com/w/cpp/chrono/time_point.html)
|
||||
{{< /callout >}}
|
||||
|
||||
```cpp
|
||||
template <typename TClock, typename TDuration = typename TClock::duration>
|
||||
class time_point
|
||||
____________________________________________________________________________________________________
|
||||
Member types
|
||||
class time_point;
|
||||
```
|
||||
Represents a point in time storing a `TDuration` indicating the time
|
||||
interval from the start of the `TClock`'s epoch.
|
||||
|
||||
## Member types
|
||||
|
||||
```cpp
|
||||
using clock = TClock
|
||||
using duration = TDuration
|
||||
using rep = typename TDuration::rep
|
||||
using period = typename TDuration::period
|
||||
____________________________________________________________________________________________________
|
||||
Constructors
|
||||
```
|
||||
|
||||
## Constructors
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR
|
||||
time_point()
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Default constructor.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
explicit time_point(const duration& dur_)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Construct from a duration.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
time_point(const time_point& rhs)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Copy constructor.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
template <typename TDuration2>
|
||||
ETL_CONSTEXPR14
|
||||
explicit time_point(const time_point<clock, TDuration2>& rhs)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Copy construct from another time_point with a different duration type.
|
||||
____________________________________________________________________________________________________
|
||||
Assignment
|
||||
|
||||
## Assignment
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
time_point& operator =(const time_point& rhs)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Assignment operator.
|
||||
____________________________________________________________________________________________________
|
||||
Access
|
||||
|
||||
## Access
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14 duration time_since_epoch() const
|
||||
ETL_NOEXCEPT
|
||||
Returns a duration representing the amount of time between this and the clock's epoch.
|
||||
____________________________________________________________________________________________________
|
||||
Member arithmetic operators
|
||||
```
|
||||
**Return**
|
||||
A duration representing the amount of time between this and the clock's epoch.
|
||||
|
||||
## Member arithmetic operators
|
||||
```cpp
|
||||
ETL_CONSTEXPR14 time_point& operator +=(const duration& rhs)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Adds a duration.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14 time_point& operator -=(const duration& rhs)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Subtracts a duration.
|
||||
____________________________________________________________________________________________________
|
||||
Constants
|
||||
|
||||
## Constants
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
static ETL_CONSTEXPR14 time_point min()
|
||||
ETL_NOEXCEPT
|
||||
Returns a time_point with the smallest possible duration.
|
||||
______________________________________________
|
||||
```
|
||||
**Return**
|
||||
A time_point with the smallest possible duration.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
static ETL_CONSTEXPR14 time_point max()
|
||||
ETL_NOEXCEPT
|
||||
Returns a time_point with the largest possible duration.
|
||||
____________________________________________________________________________________________________
|
||||
Rounding
|
||||
```
|
||||
**Return**
|
||||
A time_point with the largest possible duration.
|
||||
|
||||
## Rounding
|
||||
```cpp
|
||||
template <typename TToDuration, typename TClock, typename TDuration>
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::time_point<TClock, TToDuration>
|
||||
floor(const etl::chrono::time_point<TClock, TDuration>& tp)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Rounds down a duration to the nearest lower precision.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
template <typename TToDuration, typename TClock, typename TDuration>
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::time_point<TClock, TToDuration>
|
||||
ceil(const etl::chrono::time_point<TClock, TDuration>& tp)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Rounds up a duration to the nearest higher precision.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cp
|
||||
template <typename TToDuration, typename TClock, typename TDuration>
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::time_point<TClock, TToDuration>
|
||||
round(const etl::chrono::time_point<TClock, TDuration>& tp)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Rounds a duration to the nearest precision.
|
||||
If the duration is exactly halfway, it rounds away from zero.
|
||||
____________________________________________________________________________________________________
|
||||
Casting
|
||||
|
||||
## Casting
|
||||
```cpp
|
||||
template <typename TToDuration, typename TClock, typename TDuration>
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::time_point<TClock, TToDuration>
|
||||
time_point_cast(const etl::chrono::time_point<TClock, TDuration>& tp)
|
||||
ETL_NOEXCEPT
|
||||
____________________________________________________________________________________________________
|
||||
Comparison
|
||||
```
|
||||
|
||||
## Comparison
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14 int compare(const time_point& other) const
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Compare day with another.
|
||||
If time_point < other, returns -1
|
||||
else if time_point > other, returns 1
|
||||
else returns 0
|
||||
____________________________________________________________________________________________________
|
||||
Non-member comparison operators
|
||||
|
||||
## Non-member comparison operators
|
||||
```cpp
|
||||
template <typename TClock, typename TDuration1, typename TDuration2>
|
||||
ETL_CONSTEXPR14
|
||||
bool operator ==(const time_point<TClock, TDuration1>& lhs,
|
||||
const time_point<TClock, TDuration2>& rhs)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Equality operator
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
template <typename TClock, typename TDuration1, typename TDuration2>
|
||||
ETL_CONSTEXPR14
|
||||
bool operator !=(const time_point<TClock, TDuration1>& lhs,
|
||||
const time_point<TClock, TDuration2>& rhs)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Inequality operator
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
template <typename TClock, typename TDuration1, typename TDuration2>
|
||||
ETL_CONSTEXPR14
|
||||
bool operator <(const time_point<TClock, TDuration1>& lhs,
|
||||
const time_point<TClock, TDuration2>& rhs)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Less-than operator
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
template <typename TClock, typename TDuration1, typename TDuration2>
|
||||
ETL_CONSTEXPR14
|
||||
bool operator <=(const time_point<TClock, TDuration1>& lhs,
|
||||
const time_point<TClock, TDuration2>& rhs)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Less-than-equal operator
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
template <typename TClock, typename TDuration1, typename TDuration2>
|
||||
ETL_CONSTEXPR14
|
||||
bool operator >(const time_point<TClock, TDuration1>& lhs,
|
||||
const time_point<TClock, TDuration2>& rhs)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Greater-than operator
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
template <typename TClock, typename TDuration1, typename TDuration2>
|
||||
ETL_CONSTEXPR14
|
||||
bool operator >=(const time_point<TClock, TDuration1>& lhs,
|
||||
const time_point<TClock, TDuration2>& rhs)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Greater-than-equal operator
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
template <typename TClock, typename TDuration1, typename TDuration2>
|
||||
[[nodiscard]] constexpr auto operator <=>(const etl::chrono::time_point<TClock, TDuration1>& lhs,
|
||||
const etl::chrono::time_point<TClock, TDuration2>& rhs)
|
||||
noexcept
|
||||
```
|
||||
**Description**
|
||||
Spaceship operator
|
||||
C++20
|
||||
____________________________________________________________________________________________________
|
||||
etl::common_type specialisation
|
||||
|
||||
## etl::common_type specialisation
|
||||
```cpp
|
||||
template <typename TClock, typename TDuration1, typename TDuration2>
|
||||
struct common_type<etl::chrono::time_point<TClock, TDuration1>,
|
||||
etl::chrono::time_point<TClock, TDuration2>>
|
||||
Defines type, which is the common type of two etl::chrono::time_point
|
||||
|
||||
```
|
||||
**Description**
|
||||
Defines type, which is the common type of two `etl::chrono::time_point`.
|
||||
16
docs/chrono/weekday/_index.md
Normal file
16
docs/chrono/weekday/_index.md
Normal file
@ -0,0 +1,16 @@
|
||||
---
|
||||
title: "Weekday"
|
||||
weight: 100
|
||||
---
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `chrono.h`
|
||||
Since: `20.41.0`
|
||||
Similar to: [std::chrono](https://en.cppreference.com/w/cpp/chrono.html)
|
||||
{{< /callout >}}
|
||||
|
||||
Classes that represent weekdays.
|
||||
|
||||
`etl::chrono::weekday`
|
||||
`etl::chrono::weekday_indexed`
|
||||
`etl::chrono::weekday_last`
|
||||
17
docs/chrono/year/_index.md
Normal file
17
docs/chrono/year/_index.md
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
title: "Year"
|
||||
weight: 100
|
||||
---
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `chrono.h`
|
||||
Since: `20.41.0`
|
||||
Similar to: [std::chrono](https://en.cppreference.com/w/cpp/chrono.html)
|
||||
{{< /callout >}}
|
||||
|
||||
Classes that represent years.
|
||||
|
||||
`etl::chrono::year`
|
||||
`etl::chrono::year_month`
|
||||
`etl::chrono::year_month_day`
|
||||
`etl::chrono::year_month_day_last`
|
||||
@ -1,206 +1,328 @@
|
||||
year
|
||||
---
|
||||
title: "year"
|
||||
---
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `chrono.h`
|
||||
Since: `20.41.0`
|
||||
Similar to: [std::chrono::year](https://en.cppreference.com/w/cpp/chrono/year.html)
|
||||
{{< /callout >}}
|
||||
|
||||
A template representing a year.
|
||||
Back to chrono
|
||||
____________________________________________________________________________________________________
|
||||
year
|
||||
|
||||
STL equivalent: std::chrono::year
|
||||
|
||||
```cpp
|
||||
class year
|
||||
____________________________________________________________________________________________________
|
||||
Typesdefs
|
||||
rep The internal representation.
|
||||
____________________________________________________________________________________________________
|
||||
Construction
|
||||
```
|
||||
|
||||
## Member types
|
||||
|
||||
`rep` The internal representation.
|
||||
|
||||
## Construction
|
||||
```cpp
|
||||
ETL_CONSTEXPR
|
||||
year()
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Default constructor.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR
|
||||
explicit year(unsigned value)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Construct from unsigned.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
year(const etl::chrono::year& other)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Copy constructor.
|
||||
____________________________________________________________________________________________________
|
||||
Tests
|
||||
|
||||
## Tests
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
int compare(const etl::chrono::year& other) const
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Compare day with another.
|
||||
if year < other, returns -1
|
||||
else if year > other, returns 1
|
||||
else returns 0
|
||||
____________________________________________________________________________________________________
|
||||
Assignment
|
||||
if `year < other`, returns `-1`
|
||||
else if `year > other`, returns `1`
|
||||
else returns `0`
|
||||
|
||||
## Assignment
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year& operator =(const etl::chrono::year& rhs)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Assignment operator
|
||||
____________________________________________________________________________________________________
|
||||
Increment/decrement
|
||||
|
||||
## Increment / decrement
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year& operator ++()
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Pre-increment operator.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year operator ++(int)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Post-increment operator.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year& operator --()
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Pre-decrement operator.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year operator --(int)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Post-decrement operator.
|
||||
____________________________________________________________________________________________________
|
||||
Mathematical operators
|
||||
|
||||
## Mathematical operators
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year& operator +=(const etl::chrono::years& ys)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Plus-equals operator adding etl::chrono::years.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year& operator -=(const etl::chrono::years& ys)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Minus-equals operator subtracting etl::chrono::years.
|
||||
____________________________________________________________________________________________________
|
||||
Tests
|
||||
|
||||
## Tests
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
bool ok() const
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Returns true if the year is within the valid -32767 to 32767 range.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
bool is_leap() const
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Returns true if the year is a leap year.
|
||||
____________________________________________________________________________________________________
|
||||
Constants
|
||||
|
||||
## Constants
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
static
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year min()
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
The minimum year value for which ok() will return true.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
static
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year max()
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
The maximum year value for which ok() will return true.
|
||||
____________________________________________________________________________________________________
|
||||
Conversion
|
||||
|
||||
## Conversion
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
operator int() const
|
||||
ETL_NOEXCEPT
|
||||
Conversion operator to unsigned int.
|
||||
____________________________________________________________________________________________________
|
||||
Non-member mathematical operators
|
||||
```
|
||||
**Description**
|
||||
Conversion operator to `unsigned int`.
|
||||
|
||||
## Non-member mathematical operators
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year operator +(const etl::chrono::year& y,
|
||||
const etl::chrono::years& ys)
|
||||
ETL_NOEXCEPT
|
||||
Add etl::chrono::years to etl::chrono::year.
|
||||
Returns etl::chrono::year.
|
||||
______________________________________________
|
||||
```
|
||||
**Description**
|
||||
Add `etl::chrono::years` to `etl::chrono::year`.
|
||||
**Return**
|
||||
`etl::chrono::year`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year operator +(const etl::chrono::years& ys,
|
||||
const etl::chrono::year& y)
|
||||
ETL_NOEXCEPT
|
||||
Add etl::chrono::year to etl::chrono::years.
|
||||
Returns etl::chrono::year.
|
||||
______________________________________________
|
||||
```
|
||||
**Description**
|
||||
Add `etl::chrono::year` to `etl::chrono::years`.
|
||||
**Return**
|
||||
`etl::chrono::year`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year operator -(const etl::chrono::year& y,
|
||||
const etl::chrono::years& ys)
|
||||
ETL_NOEXCEPT
|
||||
Subtract etl::chrono::years from etl::chrono::year.
|
||||
Returns etl::chrono::year.
|
||||
______________________________________________
|
||||
```
|
||||
**Description**
|
||||
Subtract `etl::chrono::years` from `etl::chrono::year`.
|
||||
**Return**
|
||||
`etl::chrono::year`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year operator -(const etl::chrono::years& ys,
|
||||
const etl::chrono::year& y)
|
||||
ETL_NOEXCEPT
|
||||
Subtract etl::chrono::year from etl::chrono::years.
|
||||
Returns etl::chrono::years.
|
||||
______________________________________________
|
||||
```
|
||||
**Description**
|
||||
Subtract `etl::chrono::year` from `etl::chrono::years`.
|
||||
**Return**
|
||||
`etl::chrono::years`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::years operator -(const etl::chrono::year& y1,
|
||||
const etl::chrono::year& y2) ETL_NOEXCEPT
|
||||
Subtract etl::chrono::year from etl::chrono::year.
|
||||
Returns etl::chrono::years.
|
||||
____________________________________________________________________________________________________
|
||||
Non-member comparison operators
|
||||
```
|
||||
**Description**
|
||||
Subtract `etl::chrono::year` from `etl::chrono::year`.
|
||||
**Return**
|
||||
`etl::chrono::years`.
|
||||
|
||||
## Non-member comparison operators
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
bool operator ==(const etl::chrono::year& y1,
|
||||
const etl::chrono::year& y2)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Equality operator.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
bool operator !=(const etl::chrono::year& y1,
|
||||
const etl::chrono::year& y2)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Inequality operator.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
bool operator <(const etl::chrono::year& y1,
|
||||
const etl::chrono::year& y2)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Less-than operator.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
bool operator <=(const etl::chrono::year& y1,
|
||||
const etl::chrono::year& y2)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Less-than-or-equal operator.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
bool operator >(const etl::chrono::year& y1,
|
||||
const etl::chrono::year& y2)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Greater-than operator.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
bool operator >=(const etl::chrono::year& y1,
|
||||
const etl::chrono::year& y2)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Greater-than-or-equal operator.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
[[nodiscard]] inline constexpr
|
||||
auto operator <=>(const etl::chrono::year& y1,
|
||||
const etl::chrono::year& y2)
|
||||
noexcept
|
||||
Spaceship operator.
|
||||
```
|
||||
**Description**
|
||||
Spaceship operator.
|
||||
C++20
|
||||
____________________________________________________________________________________________________
|
||||
Hash
|
||||
|
||||
## Hash
|
||||
```cpp
|
||||
template <typename TRep, typename TPeriod>
|
||||
struct hash<etl::chrono::year>
|
||||
Hash function for etl::chrono::year
|
||||
```
|
||||
**Description**
|
||||
Hash function for `etl::chrono::year`.
|
||||
|
||||
@ -1,133 +1,214 @@
|
||||
year_month
|
||||
---
|
||||
title: "year_month"
|
||||
---
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `chrono.h`
|
||||
Since: `20.41.0`
|
||||
Similar to: [std::chrono::year_month](https://en.cppreference.com/w/cpp/chrono/year_month.html)
|
||||
{{< /callout >}}
|
||||
|
||||
A template representing a year and month.
|
||||
Back to chrono
|
||||
____________________________________________________________________________________________________
|
||||
year_month
|
||||
|
||||
STL equivalent: std::chrono::year_month
|
||||
|
||||
```cpp
|
||||
class year_month
|
||||
____________________________________________________________________________________________________
|
||||
Construction
|
||||
```
|
||||
|
||||
## Construction
|
||||
```cpp
|
||||
ETL_CONSTEXPR
|
||||
year_month()
|
||||
```
|
||||
**Description**
|
||||
Default constructor.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
year_month(const etl::chrono::year& y,
|
||||
const etl::chrono::month& m)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Construct from month and day.
|
||||
____________________________________________________________________________________________________
|
||||
Access
|
||||
|
||||
## Access
|
||||
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year year() const
|
||||
ETL_NOEXCEPT
|
||||
Returns the year.
|
||||
______________________________________________
|
||||
```
|
||||
**Return**
|
||||
The year.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month month() const
|
||||
ETL_NOEXCEPT
|
||||
Returns the month.
|
||||
____________________________________________________________________________________________________
|
||||
Tests
|
||||
```
|
||||
**Return**
|
||||
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& other) const
|
||||
ETL_NOEXCEPT
|
||||
if (y < other.y) return -1
|
||||
if (y > other.y) return 1
|
||||
if (m < other.m) return -1
|
||||
if (m > other.m) return 1
|
||||
else return 0
|
||||
____________________________________________________________________________________________________
|
||||
Non-member mathematical operators
|
||||
```
|
||||
**Description**
|
||||
If `y < other.y` return `-1`
|
||||
If `y > other.y` return `1`
|
||||
If `m < other.m` return `-1`
|
||||
If `m > other.m` return `1`
|
||||
Else return `0`
|
||||
|
||||
## Non-member mathematical operators
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month operator +(const etl::chrono::year_month& ym,
|
||||
const etl::chrono::years& dy)
|
||||
Adds etl::chrono::years.
|
||||
______________________________________________
|
||||
```
|
||||
**Description**
|
||||
Adds `etl::chrono::years`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month operator +(const etl::chrono::years& dy,
|
||||
const etl::chrono::year_month& ym)
|
||||
ETL_NOEXCEPT
|
||||
Adds etl::chrono::years.
|
||||
______________________________________________
|
||||
```
|
||||
**Description**
|
||||
Adds `etl::chrono::years`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month operator +(const etl::chrono::year_month& ym,
|
||||
const etl::chrono::months& dm)
|
||||
ETL_NOEXCEPT
|
||||
Adds etl::chrono::months.
|
||||
______________________________________________
|
||||
```
|
||||
**Description**
|
||||
Adds `etl::chrono::months`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month operator +(const etl::chrono::months& dm,
|
||||
const etl::chrono::year_month& ym)
|
||||
ETL_NOEXCEPT
|
||||
Adds etl::chrono::months.
|
||||
______________________________________________
|
||||
```
|
||||
**Description**
|
||||
Adds `etl::chrono::months`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month operator -(const etl::chrono::year_month& ym,
|
||||
const etl::chrono::years& dy)
|
||||
ETL_NOEXCEPT
|
||||
Subtracts etl::chrono::years.
|
||||
______________________________________________
|
||||
```
|
||||
**Description**
|
||||
Subtracts `etl::chrono::years`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month operator -(const etl::chrono::year_month& ym,
|
||||
const etl::chrono::months& dm)
|
||||
ETL_NOEXCEPT
|
||||
Subtracts etl::chrono::months.
|
||||
______________________________________________
|
||||
```
|
||||
**Description**
|
||||
Subtracts `etl::chrono::months`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::months operator -(const etl::chrono::year_month& ym1,
|
||||
const etl::chrono::year_month& ym2)
|
||||
ETL_NOEXCEPT
|
||||
Subtracts etl::chrono::year_month.
|
||||
____________________________________________________________________________________________________
|
||||
Non-member comparison operators
|
||||
```
|
||||
**Description**
|
||||
Subtracts `etl::chrono::year_month`.
|
||||
|
||||
## Non-member comparison operators
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
bool operator ==(const etl::chrono::year_month& lhs,
|
||||
const etl::chrono::year_month& rhs)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Equality operator.
|
||||
______________________________________________
|
||||
ETL_CONSTEXPR14
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
bool operator !=(const etl::chrono::year_month& lhs,
|
||||
const etl::chrono::year_month& rhs)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Inequality operator.
|
||||
______________________________________________
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
[[nodiscard]] friend constexpr
|
||||
auto operator <=>(const etl::chrono::year_month& lhs,
|
||||
const etl::chrono::year_month& rhs)
|
||||
ETL_NOEXCEPT
|
||||
Spaceship operator
|
||||
______________________________________________
|
||||
```
|
||||
**Description**
|
||||
Spaceship operator
|
||||
C++20
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
ETL_CONSTEXPR14
|
||||
int compare(const year_month& other) const
|
||||
ETL_NOEXCEPT
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Compare year_month with another.
|
||||
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
|
||||
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
|
||||
|
||||
template <typename TRep, typename TPeriod>
|
||||
struct hash<etl::chrono::year_month>
|
||||
Hash function for etl::chrono::year_month
|
||||
|
||||
**Description**
|
||||
Hash function for `etl::chrono::year_month`.
|
||||
277
docs/chrono/year/year_month_day.md
Normal file
277
docs/chrono/year/year_month_day.md
Normal file
@ -0,0 +1,277 @@
|
||||
---
|
||||
title: "year_month_day"
|
||||
---
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `chrono.h`
|
||||
Since: `20.41.0`
|
||||
Similar to: [std::chrono::year_month_day](https://en.cppreference.com/w/cpp/chrono/year_month_day.html)
|
||||
{{< /callout >}}
|
||||
|
||||
A template representing a year, month, and day.
|
||||
|
||||
```cpp
|
||||
class year_month_day
|
||||
```
|
||||
|
||||
## Construction
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR year_month_day()
|
||||
```
|
||||
**Description**
|
||||
Default constructor.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
year_month_day(const etl::chrono::year& y,
|
||||
const etl::chrono::month& m,
|
||||
const etl::chrono::day& d)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Construct from `month` and `day`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
year_month_day(const etl::chrono::year_month_day_last& ymdl)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Construct from `year_month_day_last`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
year_month_day(const etl::chrono::sys_days& sd)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Construct from `sys_days`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
year_month_day(const etl::chrono::local_days& ld)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Construct from `local_days`.
|
||||
|
||||
## Access
|
||||
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year year() const
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Return**
|
||||
The year.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::month month() const
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Return**
|
||||
The month.
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14 etl::chrono::day day() const
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Return**
|
||||
The day.
|
||||
|
||||
## Tests
|
||||
|
||||
```cpp
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
bool ok() const
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**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& other) const
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**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 if `day < other.day`, returns `-1`
|
||||
else if `day > other.day`, returns `1`
|
||||
else returns `0`
|
||||
|
||||
## operators
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_day& operator +=(const etl::chrono::years& dy)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Adds `etl::chrono::years`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_day& operator +=(const etl::chrono::months& dm)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Adds `etl::chrono::months`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_day& operator -=(const etl::chrono::years& dy)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Subtracts `etl::chrono::years`.
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_day& operator -=(const etl::chrono::months& dm)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Subtracts `etl::chrono::months`.
|
||||
|
||||
## Non-member operators
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_day operator +(const etl::chrono::year_month_day& ym,
|
||||
const etl::chrono::years& dy)
|
||||
```
|
||||
**Description**
|
||||
Adds `etl::chrono::years`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_day operator +(const etl::chrono::years& dy,
|
||||
const etl::chrono::year_month_day& ym)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Adds `etl::chrono::years`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month_day operator +(const etl::chrono::year_month_day& ym,
|
||||
const etl::chrono::months& dm)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Adds `etl::chrono::months`.
|
||||
|
||||
---
|
||||
|
||||
```
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month operator +(const etl::chrono::months& dm,
|
||||
const etl::chrono::year_month_day& ym)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Adds `etl::chrono::months`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month operator -(const etl::chrono::year_month_day& ym,
|
||||
const etl::chrono::years& dy)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Subtracts `etl::chrono::years`.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::year_month operator -(const etl::chrono::year_month_day& ym,
|
||||
const etl::chrono::months& dm)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Subtracts `etl::chrono::months`.
|
||||
|
||||
## Non-member comparison operators
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
bool operator ==(const etl::chrono::year_month_day& lhs,
|
||||
const etl::chrono::year_month_day& rhs)
|
||||
ETL_NOEXCEPT
|
||||
```
|
||||
**Description**
|
||||
Equality operator.
|
||||
|
||||
---
|
||||
|
||||
```cpp
|
||||
ETL_CONSTEXPR14
|
||||
bool operator !=(const etl::chrono::year_month_day& lhs,
|
||||
const etl::chrono::year_month_day& 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
|
||||
```
|
||||
**Description**
|
||||
Spaceship operator
|
||||
C++20
|
||||
|
||||
## Hash
|
||||
|
||||
```cpp
|
||||
template <>
|
||||
struct hash<etl::chrono::year_month_day>
|
||||
```
|
||||
**Description**
|
||||
Hash function for `etl::chrono::year_month_day`.
|
||||
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ title: "Base64"
|
||||
`base64.h` Common definitions
|
||||
`base64_encoder.h` Encoder class
|
||||
`base64_decoder.h` Decoder class
|
||||
Supported: `20.38.4`
|
||||
Since: `20.38.4`
|
||||
{{< /callout >}}
|
||||
|
||||
Encodes and decodes data to and from Base64 format.
|
||||
|
||||
@ -5,7 +5,7 @@ weight: 1
|
||||
|
||||
{{< callout >}}
|
||||
Header: `array.h`
|
||||
Supported: All versions
|
||||
Since: All versions
|
||||
Similar to: [std::array](https://en.cppreference.com/w/cpp/container/array.html)
|
||||
{{< /callout >}}
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ title: "array_view"
|
||||
|
||||
{{< callout >}}
|
||||
Header: `array_view.h`
|
||||
Supported: All versions
|
||||
Since: All versions
|
||||
Similar to: [gsl::array_view](https://learn.microsoft.com/en-us/previous-versions/cpp/parallel/amp/reference/array-view-class)
|
||||
{{< /callout >}}
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ title: "array_wrapper"
|
||||
|
||||
{{< callout >}}
|
||||
Header: `array_wrapper.h`
|
||||
Supported: All versions
|
||||
Since: All versions
|
||||
{{< /callout >}}
|
||||
|
||||
This class implements a zero cost C++ interface around a const or non-const C array. It presents the same API as std::array.
|
||||
|
||||
@ -4,7 +4,7 @@ title: "bitset"
|
||||
|
||||
{{< callout >}}
|
||||
Header: `bitset.h`
|
||||
Supported: 20.33.0
|
||||
Since: 20.33.0
|
||||
Similar to: [std::bitset](https://en.cppreference.com/w/cpp/utility/bitset.html)
|
||||
{{< /callout >}}
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ title: "bloom_filter"
|
||||
|
||||
{{< callout >}}
|
||||
Header: `bloom_filter.h`
|
||||
Supported: All versions
|
||||
Since: All versions
|
||||
{{< /callout >}}
|
||||
|
||||
```cpp
|
||||
|
||||
@ -4,7 +4,7 @@ title: "indirect_vector"
|
||||
|
||||
{{< callout >}}
|
||||
Header: `vector.h`
|
||||
Supported: All versions
|
||||
Since: All versions
|
||||
Similar to: [std::vectr](https://en.cppreference.com/w/cpp/container/vector.html)
|
||||
{{< /callout >}}
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ title: "const_map / const_map_ext"
|
||||
|
||||
{{< callout >}}
|
||||
Header: `const_map.h`
|
||||
Supported: TBC
|
||||
Since: TBC
|
||||
Similar to: [std::map](https://en.cppreference.com/w/cpp/container/map.html)
|
||||
{{< /callout >}}
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ title: "const_multimap / const_multimap_ext"
|
||||
|
||||
{{< callout >}}
|
||||
Header: `const_multimap.h`
|
||||
Supported: TBC
|
||||
Since: TBC
|
||||
Similar to: [std::multimap](https://en.cppreference.com/w/cpp/container/multimap.html)
|
||||
{{< /callout >}}
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ title: "vector"
|
||||
|
||||
{{< callout >}}
|
||||
Header: `vector.h`
|
||||
Supported: All versions
|
||||
Since: All versions
|
||||
Similar to: [std::vectr](https://en.cppreference.com/w/cpp/container/vector.html)
|
||||
{{< /callout >}}
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ weight: 1
|
||||
|
||||
{{< callout type="info">}}
|
||||
Header: `my_class.h`
|
||||
Supported: `xx.yy.zz`
|
||||
Since: `xx.yy.zz`
|
||||
Similar to: [Some similar in the STL](https://en.cppreference.com/w/cpp/stl_header.html)
|
||||
{{< /callout >}}
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ weight: 1
|
||||
|
||||
{{< callout >}}
|
||||
Header: `ranges.h`
|
||||
Supported: 20.46.2
|
||||
Since: 20.46.2
|
||||
Similar to: [std::ranges](https://en.cppreference.com/w/cpp/ranges.html)
|
||||
{{< /callout >}}
|
||||
|
||||
|
||||
@ -1,87 +0,0 @@
|
||||
hh_mm_ss
|
||||
A type to hold hous, minutes, and seconds.
|
||||
Back to chrono
|
||||
____________________________________________________________________________________________________
|
||||
absolute
|
||||
|
||||
template <typename TDuration>
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
TDuration absolute(TDuration dur)
|
||||
ETL_NOEXCEPT
|
||||
A specialisation of absolute for etl::chrono::duration.
|
||||
Returns the absolute duration value.
|
||||
____________________________________________________________________________________________________
|
||||
hh_mm_ss
|
||||
|
||||
template <typename TDuration>
|
||||
class hh_mm_ss
|
||||
|
||||
Static asserts if TDuration is not a specialisation of etl::chrono::duration.
|
||||
____________________________________________________________________________________________________
|
||||
Class constant
|
||||
|
||||
static constexpr int fractional_width;
|
||||
The number of fractional digits.
|
||||
____________________________________________________________________________________________________
|
||||
Class type
|
||||
|
||||
precision
|
||||
The return type for to_duration.
|
||||
____________________________________________________________________________________________________
|
||||
Constructors
|
||||
|
||||
ETL_CONSTEXPR
|
||||
hh_mm_ss()
|
||||
ETL_NOEXCEPT
|
||||
Default constructor.
|
||||
______________________________________________
|
||||
ETL_CONSTEXPR14
|
||||
explicit hh_mm_ss(TDuration d)
|
||||
ETL_NOEXCEPT
|
||||
Construct from duration.
|
||||
____________________________________________________________________________________________________
|
||||
Access
|
||||
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
bool is_negative() const
|
||||
ETL_NOEXCEPT
|
||||
Checks for negative duration.
|
||||
______________________________________________
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::hours hours() const
|
||||
ETL_NOEXCEPT
|
||||
Returns the hours.
|
||||
______________________________________________
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::minutes minutes() const
|
||||
ETL_NOEXCEPT
|
||||
Returns the minutes.
|
||||
______________________________________________
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
etl::chrono::seconds seconds() const
|
||||
ETL_NOEXCEPT
|
||||
Returns the seconds.
|
||||
______________________________________________
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
precision subseconds() const
|
||||
ETL_NOEXCEPT
|
||||
Returns the subseconds.
|
||||
______________________________________________
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
explicit operator precision() const
|
||||
ETL_NOEXCEPT
|
||||
Returns the duration.
|
||||
______________________________________________
|
||||
ETL_NODISCARD
|
||||
ETL_CONSTEXPR14
|
||||
precision to_duration() const
|
||||
ETL_NOEXCEPT
|
||||
Returns the duration.
|
||||
|
||||
@ -1,17 +0,0 @@
|
||||
last_spec
|
||||
last_spec is a tag type that is used in conjunction with other calendar types to indicate the last thing in a sequence.
|
||||
Back to chrono
|
||||
____________________________________________________________________________________________________
|
||||
last_spec
|
||||
|
||||
struct last_spec
|
||||
{
|
||||
explicit last_spec() = default;
|
||||
};
|
||||
|
||||
inline constexpr last_spec last{};
|
||||
|
||||
Example:
|
||||
|
||||
2025_y/March/last for last day of March 2025 i.e. 2025-03-31
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user