tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
month_weekday.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2023 Tobias Hienzsch
3
4#ifndef TETL_CHRONO_MONTH_WEEKDAY_HPP
5#define TETL_CHRONO_MONTH_WEEKDAY_HPP
6
7#include <etl/_chrono/month.hpp>
8#include <etl/_chrono/weekday_indexed.hpp>
9
10namespace etl::chrono {
11
12/// \ingroup chrono
14 constexpr month_weekday(chrono::month const& m, chrono::weekday_indexed const& wdi) noexcept
15 : _m{m}
16 , _wdi{wdi}
17 {
18 }
19
20 [[nodiscard]] constexpr auto month() const noexcept -> chrono::month
21 {
22 return _m;
23 }
24
25 [[nodiscard]] constexpr auto weekday_indexed() const noexcept -> chrono::weekday_indexed
26 {
27 return _wdi;
28 }
29
30 [[nodiscard]] constexpr auto ok() const noexcept -> bool
31 {
33 }
34
35 friend constexpr auto operator==(month_weekday const& lhs, month_weekday const& rhs) noexcept -> bool
36 {
38 }
39
40private:
41 chrono::month _m;
43};
44
45[[nodiscard]] constexpr auto operator/(month const& m, weekday_indexed const& wdi) noexcept -> month_weekday
46{
47 return {m, wdi};
48}
49
50[[nodiscard]] constexpr auto operator/(int m, weekday_indexed const& wdi) noexcept -> month_weekday
51{
52 return {month(static_cast<unsigned>(m)), wdi};
53}
54
55[[nodiscard]] constexpr auto operator/(weekday_indexed const& wdi, month const& m) noexcept -> month_weekday
56{
57 return {m, wdi};
58}
59
60[[nodiscard]] constexpr auto operator/(weekday_indexed const& wdi, int m) noexcept -> month_weekday
61{
62 return {month(static_cast<unsigned>(m)), wdi};
63}
64
65} // namespace etl::chrono
66
67#endif // TETL_CHRONO_MONTH_WEEKDAY_HPP
Definition abs.hpp:12
constexpr auto operator/(weekday_indexed const &wdi, month const &m) noexcept -> month_weekday
Definition month_weekday.hpp:55
constexpr auto operator/(month const &m, weekday_indexed const &wdi) noexcept -> month_weekday
Definition month_weekday.hpp:45
constexpr auto operator==(month lhs, month rhs) noexcept -> bool
Definition month.hpp:53
constexpr auto operator/(int m, weekday_indexed const &wdi) noexcept -> month_weekday
Definition month_weekday.hpp:50
constexpr auto operator/(weekday_indexed const &wdi, int m) noexcept -> month_weekday
Definition month_weekday.hpp:60
Definition adjacent_find.hpp:9
Definition month_weekday.hpp:13
constexpr auto ok() const noexcept -> bool
Definition month_weekday.hpp:30
constexpr month_weekday(chrono::month const &m, chrono::weekday_indexed const &wdi) noexcept
Definition month_weekday.hpp:14
constexpr auto weekday_indexed() const noexcept -> chrono::weekday_indexed
Definition month_weekday.hpp:25
constexpr auto month() const noexcept -> chrono::month
Definition month_weekday.hpp:20
friend constexpr auto operator==(month_weekday const &lhs, month_weekday const &rhs) noexcept -> bool
Definition month_weekday.hpp:35
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
Definition weekday_indexed.hpp:12
constexpr auto ok() const noexcept -> bool
Definition weekday_indexed.hpp:31
friend constexpr auto operator==(weekday_indexed const &lhs, weekday_indexed const &rhs) noexcept -> bool
Definition weekday_indexed.hpp:36