4#ifndef TETL_CHRONO_MONTH_DAY_HPP
5#define TETL_CHRONO_MONTH_DAY_HPP
7#include <etl/_array/array.hpp>
8#include <etl/_chrono/day.hpp>
9#include <etl/_chrono/month.hpp>
35 constexpr auto maxDaysInMonth =
array<uint8_t, 12>{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
39 if (
static_cast<
unsigned>(
day()) < 1) {
42 return static_cast<
unsigned>(
day()) <= maxDaysInMonth
[unsigned{
month()} - 1
];
61 return {m
, day(static_cast<
unsigned>(d)
)};
constexpr auto operator/(month const &m, day const &d) noexcept -> month_day
Definition month_day.hpp:55
constexpr auto operator/(month const &m, int d) noexcept -> month_day
Definition month_day.hpp:59
constexpr auto operator==(month lhs, month rhs) noexcept -> bool
Definition month.hpp:53
constexpr auto operator/(day const &d, month const &m) noexcept -> month_day
Definition month_day.hpp:67
constexpr auto operator/(day const &d, int m) noexcept -> month_day
Definition month_day.hpp:71
constexpr auto operator/(int m, day const &d) noexcept -> month_day
Definition month_day.hpp:63
Definition adjacent_find.hpp:9
A container that encapsulates fixed size arrays.
Definition array.hpp:49
constexpr auto operator[](size_type const pos) const noexcept -> const_reference
Accesses the specified item with range checking.
Definition array.hpp:74
The class day represents a day in a month.
Definition day.hpp:21
friend constexpr auto operator==(day lhs, day rhs) noexcept -> bool
Definition day.hpp:76
constexpr day(unsigned d) noexcept
Definition day.hpp:24
Definition month_day.hpp:14
constexpr auto ok() const noexcept -> bool
Definition month_day.hpp:33
friend constexpr auto operator==(month_day const &lhs, month_day const &rhs) noexcept -> bool
Definition month_day.hpp:45
constexpr auto month() const noexcept -> chrono::month
Definition month_day.hpp:23
constexpr month_day(chrono::month const &m, chrono::day const &d) noexcept
Definition month_day.hpp:17
constexpr auto day() const noexcept -> chrono::day
Definition month_day.hpp:28
The class month represents a month in a year.
Definition month.hpp:22
constexpr auto ok() const noexcept -> bool
Definition month.hpp:31
constexpr month(unsigned m) noexcept
Definition month.hpp:25