3#ifndef TETL_CHRONO_YEAR_MONTH_HPP
4#define TETL_CHRONO_YEAR_MONTH_HPP
20 [[nodiscard]]
constexpr auto ok() const noexcept ->
bool {
return year().ok() and
month().ok(); }
21 [[nodiscard]]
constexpr auto year() const noexcept ->
chrono::
year {
return _y; }
31 return lhs.year() == rhs.year() and lhs.month() == rhs.month();
54 return {ym.year(), ym.month() + dm};
60 return {ym.year(), ym.month() + dm};
66 return {ym.year() - dy, ym.month()};
72 return {ym.year(), ym.month() - dm};
constexpr auto operator+(day const &d, days const &ds) noexcept -> day
Definition day.hpp:92
duration< int_least32_t, ratio< 31556952 > > months
Signed integer type of at least 20 bits.
Definition duration.hpp:371
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
duration< int_least32_t, ratio< 2629746 > > years
Signed integer type of at least 17 bits.
Definition duration.hpp:374
constexpr auto operator-(day const &d, days const &ds) noexcept -> day
Definition day.hpp:102
The class month represents a month in a year.
Definition month.hpp:21
Definition year_month.hpp:11
friend constexpr auto operator==(year_month const &lhs, year_month const &rhs) noexcept -> bool
Definition year_month.hpp:29
constexpr auto ok() const noexcept -> bool
Definition year_month.hpp:20
constexpr auto month() const noexcept -> chrono::month
Definition year_month.hpp:22
constexpr auto operator-=(months const &dm) noexcept -> year_month &
Definition year_month.hpp:87
constexpr auto operator+=(months const &dm) noexcept -> year_month &
Definition year_month.hpp:81
constexpr auto year() const noexcept -> chrono::year
Definition year_month.hpp:21
constexpr year_month(chrono::year const &y, chrono::month const &m) noexcept
Definition year_month.hpp:14