# Conflicts: # docs/IO/io_port.md # docs/containers/sets/const-multiset.md # docs/containers/sets/const-set.md # docs/maths/correlation.md # docs/maths/gamma.md
5.6 KiB
| title |
|---|
| month |
{{< callout type="info">}}
Header: chrono.h
From: 20.41.0
Similar to: std::chrono::month
{{< /callout >}}
A class representing a month.
class month
Member types
rep The internal representation.
Construction
ETL_CONSTEXPR
month()
ETL_NOEXCEPT
Description
Default constructor.
ETL_CONSTEXPR
explicit month(unsigned value)
ETL_NOEXCEPT
Description
Construct from unsigned.
ETL_CONSTEXPR14
month(const etl::chrono::month& other)
ETL_NOEXCEPT
Description
Copy constructor.
Tests
ETL_NODISCARD
ETL_CONSTEXPR14
bool ok() const
ETL_NOEXCEPT
Description
Returns true if the month is in range.
ETL_NODISCARD
ETL_CONSTEXPR14
int compare(const etl::chrono::month& other) const
ETL_NOEXCEPT
Description
Compare month with another.
if month < other, returns -1
else if month > other, returns 1
else returns 0
Assignment
ETL_CONSTEXPR14
etl::chrono::month& operator =(const etl::chrono::month& rhs)
ETL_NOEXCEPT
Description
Assignment operator
Increment / decrement
ETL_CONSTEXPR14
etl::chrono::month& operator ++()
ETL_NOEXCEPT
Description
Pre-increment operator.
ETL_CONSTEXPR14
etl::chrono::month operator ++(int)
ETL_NOEXCEPT
Description
Post-increment operator.
ETL_CONSTEXPR14
etl::chrono::month& operator --()
ETL_NOEXCEPT
Description
Pre-decrement operator.
ETL_CONSTEXPR14
etl::chrono::month operator --(int)
ETL_NOEXCEPT
Description
Post-decrement operator.
Mathematical operators
ETL_CONSTEXPR14
etl::chrono::month& operator +=(const etl::chrono::months& ms)
ETL_NOEXCEPT
Description
Plus-equals operator adding etl::chrono::months.
ETL_CONSTEXPR14
etl::chrono::month& operator -=(const etl::chrono::months& ms)
ETL_NOEXCEPT
Description
Minus-equals operator subtracting etl::chrono::months.
Constants
ETL_NODISCARD
static
ETL_CONSTEXPR14
etl::chrono::month min()
ETL_NOEXCEPT
Description
The minimum month value for which ok() will return true.
ETL_NODISCARD
static
ETL_CONSTEXPR14
etl::chrono::month max()
ETL_NOEXCEPT
Description
The maximum month value for which ok() will return true.
Conversion
ETL_CONSTEXPR14
operator unsigned() const
ETL_NOEXCEPT
Description
Conversion operator to unsigned int.
Non-member mathematical operators
ETL_CONSTEXPR14
etl::chrono::month operator +(const etl::chrono::month& m,
const etl::chrono::months& ms)
ETL_NOEXCEPT
Description
Add etl::chrono::months to etl::chrono::month.
Return
etl::chrono::month.
ETL_CONSTEXPR14
etl::chrono::month operator +(const etl::chrono::months& ms,
const etl::chrono::month& m)
ETL_NOEXCEPT
Description
Add etl::chrono::month to etl::chrono::months.
Return
etl::chrono::month.
ETL_CONSTEXPR14
etl::chrono::month operator -(const etl::chrono::month& m,
const etl::chrono::months& ms)
ETL_NOEXCEPT
Description
Subtract etl::chrono::months from etl::chrono::month.
Return
etl::chrono::month.
ETL_CONSTEXPR14
etl::chrono::month operator -(const etl::chrono::months& ms,
const etl::chrono::month& m)
ETL_NOEXCEPT
Description
Subtract etl::chrono::month from etl::chrono::months.
Return
etl::chrono::months.
ETL_CONSTEXPR14
etl::chrono::months operator -(const etl::chrono::month& m1,
const etl::chrono::month& m2) ETL_NOEXCEPT
Description
Subtract etl::chrono::month from etl::chrono::month.
Return
etl::chrono::months.
Non-member comparison operators
ETL_CONSTEXPR14
bool operator ==(const etl::chrono::month& m1,
const etl::chrono::month& m2)
ETL_NOEXCEPT
Description
Equality operator.
ETL_CONSTEXPR14
bool operator !=(const etl::chrono::month& m1,
const etl::chrono::month& m2)
ETL_NOEXCEPT
Description
Inequality operator.
ETL_CONSTEXPR14
bool operator <(const etl::chrono::month& m1,
const etl::chrono::month& m2)
ETL_NOEXCEPT
Description
Less-than operator.
ETL_CONSTEXPR14
bool operator <=(const etl::chrono::month& m1,
const etl::chrono::month& m2)
ETL_NOEXCEPT
Description
Less-than-or-equal operator.
ETL_CONSTEXPR14
bool operator >(const etl::chrono::month& m1,
const etl::chrono::month& m2)
ETL_NOEXCEPT
Description
Greater-than operator.
ETL_CONSTEXPR14
bool operator >=(const etl::chrono::month& m1,
const etl::chrono::month& m2)
ETL_NOEXCEPT
Description
Greater-than-or-equal operator.
[[nodiscard]] inline constexpr
auto operator <=>(const etl::chrono::month& m1,
const etl::chrono::month& m2)
noexcept
Description
Spaceship operator.
C++20
Defined months
etl::chrono::January
etl::chrono::February
etl::chrono::March
etl::chrono::April
etl::chrono::May
etl::chrono::June
etl::chrono::July
etl::chrono::August
etl::chrono::September
etl::chrono::October
etl::chrono::November
etl::chrono::December
Hash
template <>
struct hash<etl::chrono::month>
Hash function for etl::chrono::month.