3#ifndef TETL_CHRONO_MONTH_DAY_HPP
4#define TETL_CHRONO_MONTH_DAY_HPP
24 [[nodiscard]]
constexpr auto day() const noexcept ->
chrono::
day {
return _d; }
26 [[nodiscard]]
constexpr auto ok() const noexcept ->
bool
28 constexpr auto maxDaysInMonth =
array<uint8_t, 12>{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
32 if (
static_cast<unsigned>(
day()) < 1) {
35 return static_cast<unsigned>(
day()) <= maxDaysInMonth[
unsigned{
month()} - 1];
40 return lhs.month() == rhs.month() and lhs.day() == rhs.day();
51 return {m,
day(
static_cast<unsigned>(d))};
55 return {
month(
static_cast<unsigned>(m)), d};
60 return {
month(
static_cast<unsigned>(m)), d};
constexpr auto operator/(duration< Rep1, Period1 > const &lhs, duration< Rep2, Period2 > const &rhs) -> common_type_t< Rep1, Rep2 >
Performs basic arithmetic operations between two durations or between a duration and a tick count.
Definition duration.hpp:272
A container that encapsulates fixed size arrays.
Definition array.hpp:48
The class day represents a day in a month.
Definition day.hpp:20
Definition month_day.hpp:13
constexpr auto ok() const noexcept -> bool
Definition month_day.hpp:26
friend constexpr auto operator==(month_day const &lhs, month_day const &rhs) noexcept -> bool
Definition month_day.hpp:38
constexpr auto month() const noexcept -> chrono::month
Definition month_day.hpp:22
constexpr month_day(chrono::month const &m, chrono::day const &d) noexcept
Definition month_day.hpp:16
constexpr auto day() const noexcept -> chrono::day
Definition month_day.hpp:24
The class month represents a month in a year.
Definition month.hpp:21