A C++ template library for embedded applications
MIT licensed
Designed and
maintained by
John Wellbelove
month
A template representing a month.
Back to chrono
____________________________________________________________________________________________________
month

STL equivalent: std::chrono::month

class month
____________________________________________________________________________________________________
Typesdefs
rep  The internal representation.
____________________________________________________________________________________________________
Construction

ETL_CONSTEXPR
month()
ETL_NOEXCEPT
Default constructor.
______________________________________________
ETL_CONSTEXPR
explicit month(unsigned value)
ETL_NOEXCEPT
Construct from unsigned.
______________________________________________
ETL_CONSTEXPR14
month(const etl::chrono::month& other)
ETL_NOEXCEPT
Copy constructor.
____________________________________________________________________________________________________
Tests

ETL_NODISCARD
ETL_CONSTEXPR14
bool ok() const
ETL_NOEXCEPT
Returns true if the month is in range.
______________________________________________
ETL_NODISCARD
ETL_CONSTEXPR14
int compare(const etl::chrono::month& other) const
ETL_NOEXCEPT
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
Assignment operator     
____________________________________________________________________________________________________
Increment/decrement

ETL_CONSTEXPR14
etl::chrono::month& operator ++()
ETL_NOEXCEPT
Pre-increment operator.
______________________________________________
ETL_CONSTEXPR14
etl::chrono::month operator ++(int)
ETL_NOEXCEPT
Post-increment operator.
______________________________________________
ETL_CONSTEXPR14
etl::chrono::month& operator --()
ETL_NOEXCEPT
Pre-decrement operator.
______________________________________________
ETL_CONSTEXPR14
etl::chrono::month operator --(int)
ETL_NOEXCEPT
Post-decrement operator.
____________________________________________________________________________________________________
Mathematical operators

ETL_CONSTEXPR14
etl::chrono::month& operator +=(const etl::chrono::months& ms)
ETL_NOEXCEPT
Plus-equals operator adding etl::chrono::months.
______________________________________________
ETL_CONSTEXPR14
etl::chrono::month& operator -=(const etl::chrono::months& ms)
ETL_NOEXCEPT
Minus-equals operator subtracting etl::chrono::months.
____________________________________________________________________________________________________
Constants

ETL_NODISCARD
static
ETL_CONSTEXPR14
etl::chrono::month min()
ETL_NOEXCEPT
The minimum month value for which ok() will return true.
______________________________________________
ETL_NODISCARD
static
ETL_CONSTEXPR14
etl::chrono::month max()
ETL_NOEXCEPT
The maximum month  value for which ok() will return true.
____________________________________________________________________________________________________
Conversion

ETL_CONSTEXPR14
operator unsigned() const
ETL_NOEXCEPT
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
Add etl::chrono::months to etl::chrono::month.
Returns etl::chrono::month.
______________________________________________
ETL_CONSTEXPR14
etl::chrono::month operator +(const etl::chrono::months& ms,
                              const etl::chrono::month& m)
ETL_NOEXCEPT
Add etl::chrono::month to etl::chrono::months.
Returns etl::chrono::month.
______________________________________________
ETL_CONSTEXPR14
etl::chrono::month operator -(const etl::chrono::month& m,
                              const etl::chrono::months& ms)
ETL_NOEXCEPT
Subtract etl::chrono::months from etl::chrono::month.
Returns etl::chrono::month.
______________________________________________
ETL_CONSTEXPR14
etl::chrono::month operator -(const etl::chrono::months& ms,
                              const etl::chrono::month& m)
ETL_NOEXCEPT
Subtract etl::chrono::month from etl::chrono::months.
Returns etl::chrono::months.
______________________________________________
ETL_CONSTEXPR14
etl::chrono::months operator -(const etl::chrono::month& m1,
                               const etl::chrono::month& m2) ETL_NOEXCEPT
Subtract etl::chrono::month from etl::chrono::month.
Returns etl::chrono::months.
____________________________________________________________________________________________________
Non-member comparison operators

ETL_CONSTEXPR14
bool operator ==(const etl::chrono::month& m1,
                 const etl::chrono::month& m2)
ETL_NOEXCEPT
Equality operator.
______________________________________________
ETL_CONSTEXPR14
bool operator !=(const etl::chrono::month& m1,
                 const etl::chrono::month& m2)
ETL_NOEXCEPT
Inequality operator.
______________________________________________
ETL_CONSTEXPR14
bool operator <(const etl::chrono::month& m1,
                const etl::chrono::month& m2)
ETL_NOEXCEPT
Less-than operator.
______________________________________________
ETL_CONSTEXPR14
bool operator <=(const etl::chrono::month& m1,
                 const etl::chrono::month& m2)
ETL_NOEXCEPT
Less-than-or-equal operator.
______________________________________________
ETL_CONSTEXPR14
bool operator >(const etl::chrono::month& m1,
                const etl::chrono::month& m2)
ETL_NOEXCEPT
Greater-than operator.
______________________________________________
ETL_CONSTEXPR14
bool operator >=(const etl::chrono::month& m1,
                 const etl::chrono::month& m2)
ETL_NOEXCEPT
Greater-than-or-equal operator.
______________________________________________
[[nodiscard]] inline constexpr
auto operator <=>(const etl::chrono::month& m1,
                  const etl::chrono::month& m2)
noexcept
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
chrono.h