month_day
A class representing a month and day.
class month_dayConstruction
ETL_CONSTEXPR
month_day()Description
Default constructor.
ETL_CONSTEXPR14
month_day(const etl::chrono::month& m,
const etl::chrono::day& d)
ETL_NOEXCEPTDescription
Construct from month and day.
Access
ETL_NODISCARD
ETL_CONSTEXPR14
etl::chrono::month month() const
ETL_NOEXCEPTReturn
The month.
ETL_NODISCARD
ETL_CONSTEXPR14
etl::chrono::day day() const
ETL_NOEXCEPTReturn
The day.
Tests
ETL_NODISCARD
ETL_CONSTEXPR14
bool ok() const
ETL_NOEXCEPTReturn
true if the month and day is within the valid limits.
ETL_CONSTEXPR14
int compare(const month_day& other) const
ETL_NOEXCEPT
Description
Compare month_day 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
Non-member comparison operators
ETL_CONSTEXPR14
bool operator ==(const etl::chrono::month_day& lhs,
const etl::chrono::month_day& rhs)
ETL_NOEXCEPTDescription
Equality operator.
ETL_CONSTEXPR14
bool operator !=(const etl::chrono::month_day& lhs,
const etl::chrono::month_day& rhs)
ETL_NOEXCEPTDescription
Inequality operator.
ETL_CONSTEXPR14
bool operator <(const etl::chrono::month_day& lhs,
const etl::chrono::month_day& rhs)
ETL_NOEXCEPTDescription
Less-than operator.
ETL_CONSTEXPR14
bool operator <=(const etl::chrono::month_day& lhs,
const etl::chrono::month_day& rhs)
ETL_NOEXCEPTDescription
Less-than-equal operator.
ETL_CONSTEXPR14
bool operator <(const etl::chrono::month_day& lhs,
const etl::chrono::month_day& rhs)
ETL_NOEXCEPTDescription
Greater-than operator.
ETL_CONSTEXPR14
bool operator <=(const etl::chrono::month_day& lhs,
const etl::chrono::month_day& rhs)
ETL_NOEXCEPTDescription
Greater-than-equal operator.
[[nodiscard]] constexpr
auto operator <=>(const etl::chrono::month_day& lhs,
const etl::chrono::month_day& rhs)
ETL_NOEXCEPTDescription
Spaceship operator.
C++20
Hash
template <typename TRep, typename TPeriod>
struct hash<etl::chrono::month_day>Description
Hash function for etl::chrono::month_day.