Embedded Template Library 1.0
Loading...
Searching...
No Matches
operators.h
Go to the documentation of this file.
1
2
3/******************************************************************************
4The MIT License(MIT)
5
6Embedded Template Library.
7https://github.com/ETLCPP/etl
8https://www.etlcpp.com
9
10Copyright(c) 2025 John Wellbelove
11
12Permission is hereby granted, free of charge, to any person obtaining a copy
13of this software and associated documentation files(the "Software"), to deal
14in the Software without restriction, including without limitation the rights
15to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
16copies of the Software, and to permit persons to whom the Software is
17furnished to do so, subject to the following conditions :
18
19The above copyright notice and this permission notice shall be included in all
20copies or substantial portions of the Software.
21
22THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE
25AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28SOFTWARE.
29******************************************************************************/
30
31#ifndef ETL_IN_CHRONO_H
32 #error DO NOT DIRECTLY INCLUDE THIS FILE. USE CHRONO.H
33#endif
34
35namespace etl
36{
37 namespace chrono
38 {
39 //*************************************************************************
40 // month_day
41 inline ETL_CONSTEXPR14 etl::chrono::month_day operator/(const etl::chrono::month& m, const etl::chrono::day& d) ETL_NOEXCEPT
42 {
43 return etl::chrono::month_day(m, d);
44 }
45
46 // month_day
47 inline ETL_CONSTEXPR14 etl::chrono::month_day operator/(const etl::chrono::month& m, int d) ETL_NOEXCEPT
48 {
49 return etl::chrono::month_day(m, etl::chrono::day(static_cast<unsigned>(d)));
50 }
51
52 // month_day
53 inline ETL_CONSTEXPR14 etl::chrono::month_day operator/(int m, const etl::chrono::day& d) ETL_NOEXCEPT
54 {
55 return etl::chrono::month_day(etl::chrono::month(static_cast<unsigned>(m)), d);
56 }
57
58 // month_day
59 inline ETL_CONSTEXPR14 etl::chrono::month_day operator/(const etl::chrono::day& d, const etl::chrono::month& m) ETL_NOEXCEPT
60 {
61 return etl::chrono::month_day(m, d);
62 }
63
64 // month_day
65 inline ETL_CONSTEXPR14 etl::chrono::month_day operator/(const etl::chrono::day& d, int m) ETL_NOEXCEPT
66 {
67 return etl::chrono::month_day(etl::chrono::month(static_cast<unsigned>(m)), d);
68 }
69
70 //*************************************************************************
71 // month_day_last
72 inline ETL_CONSTEXPR14 etl::chrono::month_day_last operator/(const etl::chrono::month& m, etl::chrono::last_spec) ETL_NOEXCEPT
73 {
74 return etl::chrono::month_day_last(m);
75 }
76
77 // month_day_last
78 inline ETL_CONSTEXPR14 etl::chrono::month_day_last operator/(int m, etl::chrono::last_spec) ETL_NOEXCEPT
79 {
80 return etl::chrono::month_day_last(etl::chrono::month(static_cast<unsigned>(m)));
81 }
82
83 // month_day_last
84 inline ETL_CONSTEXPR14 etl::chrono::month_day_last operator/(etl::chrono::last_spec, const etl::chrono::month& m) ETL_NOEXCEPT
85 {
86 return etl::chrono::month_day_last(m);
87 }
88
89 // month_day_last
90 inline ETL_CONSTEXPR14 etl::chrono::month_day_last operator/(etl::chrono::last_spec, int m) ETL_NOEXCEPT
91 {
92 return etl::chrono::month_day_last(etl::chrono::month(static_cast<unsigned>(m)));
93 }
94
95 //*************************************************************************
96 // month_weekday
97 inline ETL_CONSTEXPR14 etl::chrono::month_weekday operator/(const etl::chrono::month& m, const etl::chrono::weekday_indexed& wdi) ETL_NOEXCEPT
98 {
99 return etl::chrono::month_weekday(m, wdi);
100 }
101
102 // month_weekday
103 inline ETL_CONSTEXPR14 etl::chrono::month_weekday operator/(int m, const etl::chrono::weekday_indexed& wdi) ETL_NOEXCEPT
104 {
105 return etl::chrono::month_weekday(etl::chrono::month(static_cast<unsigned>(m)), wdi);
106 }
107
108 // month_weekday
109 inline ETL_CONSTEXPR14 etl::chrono::month_weekday operator/(const etl::chrono::weekday_indexed& wdi, const etl::chrono::month& m) ETL_NOEXCEPT
110 {
111 return etl::chrono::month_weekday(m, wdi);
112 }
113
114 // month_weekday
115 inline ETL_CONSTEXPR14 etl::chrono::month_weekday operator/(const etl::chrono::weekday_indexed& wdi, int m) ETL_NOEXCEPT
116 {
117 return etl::chrono::month_weekday(etl::chrono::month(static_cast<unsigned>(m)), wdi);
118 }
119
120 //*************************************************************************
121 // month_weekday_last
122 inline ETL_CONSTEXPR14 etl::chrono::month_weekday_last operator/(const etl::chrono::month& m, const etl::chrono::weekday_last& wdl) ETL_NOEXCEPT
123 {
124 return etl::chrono::month_weekday_last(m, wdl);
125 }
126
127 // month_weekday_last
128 inline ETL_CONSTEXPR14 etl::chrono::month_weekday_last operator/(int m, const etl::chrono::weekday_last& wdl) ETL_NOEXCEPT
129 {
130 return etl::chrono::month_weekday_last(etl::chrono::month(static_cast<unsigned>(m)), wdl);
131 }
132
133 // month_weekday_last
134 inline ETL_CONSTEXPR14 etl::chrono::month_weekday_last operator/(const etl::chrono::weekday_last& wdl, const etl::chrono::month& m) ETL_NOEXCEPT
135 {
136 return etl::chrono::month_weekday_last(m, wdl);
137 }
138
139 // month_weekday_last
140 inline ETL_CONSTEXPR14 etl::chrono::month_weekday_last operator/(const etl::chrono::weekday_last& wdl, int m) ETL_NOEXCEPT
141 {
142 return etl::chrono::month_weekday_last(etl::chrono::month(static_cast<unsigned>(m)), wdl);
143 }
144
145 //*************************************************************************
146 // year_month
147 inline ETL_CONSTEXPR14 etl::chrono::year_month operator/(const etl::chrono::year& y, const etl::chrono::month& m) ETL_NOEXCEPT
148 {
149 return etl::chrono::year_month(y, m);
150 }
151
152 // year_month
153 inline ETL_CONSTEXPR14 etl::chrono::year_month operator/(const etl::chrono::year& y, int m) ETL_NOEXCEPT
154 {
155 return etl::chrono::year_month(y, etl::chrono::month(static_cast<unsigned>(m)));
156 }
157
159 // year_month_day
160 inline ETL_CONSTEXPR14 etl::chrono::year_month_day operator/(const etl::chrono::year_month& ym, const etl::chrono::day& d) ETL_NOEXCEPT
161 {
162 return etl::chrono::year_month_day(ym.year(), ym.month(), d);
163 }
164
165 // year_month_day
166 inline ETL_CONSTEXPR14 etl::chrono::year_month_day operator/(const etl::chrono::year_month& ym, int d) ETL_NOEXCEPT
167 {
168 return etl::chrono::year_month_day(ym.year(), ym.month(), etl::chrono::day(static_cast<unsigned>(d)));
169 }
170
171 // year_month_day
172 inline ETL_CONSTEXPR14 etl::chrono::year_month_day operator/(const etl::chrono::year& y, const etl::chrono::month_day& md) ETL_NOEXCEPT
173 {
174 return etl::chrono::year_month_day(y, md.month(), md.day());
175 }
176
177 // year_month_day
178 inline ETL_CONSTEXPR14 etl::chrono::year_month_day operator/(int y, const etl::chrono::month_day& md) ETL_NOEXCEPT
179 {
180 return etl::chrono::year_month_day(etl::chrono::year(y), md.month(), md.day());
181 }
182
183 // year_month_day
184 inline ETL_CONSTEXPR14 etl::chrono::year_month_day operator/(const etl::chrono::month_day& md, const etl::chrono::year& y) ETL_NOEXCEPT
185 {
186 return etl::chrono::year_month_day(y, md.month(), md.day());
187 }
188
189 // year_month_day
190 inline ETL_CONSTEXPR14 etl::chrono::year_month_day operator/(const etl::chrono::month_day& md, int y) ETL_NOEXCEPT
191 {
192 return etl::chrono::year_month_day(etl::chrono::year(y), md.month(), md.day());
193 }
194
195 //*************************************************************************
196 // year_month_day_last
197 inline ETL_CONSTEXPR14 etl::chrono::year_month_day_last operator/(const etl::chrono::year_month& ym, etl::chrono::last_spec) ETL_NOEXCEPT
198 {
199 return etl::chrono::year_month_day_last(ym.year(), etl::chrono::month_day_last(ym.month()));
200 }
201
202 // year_month_day_last
203 inline ETL_CONSTEXPR14 etl::chrono::year_month_day_last operator/(const etl::chrono::year& y, const etl::chrono::month_day_last& mdl) ETL_NOEXCEPT
204 {
205 return etl::chrono::year_month_day_last(y, mdl);
206 }
207
208 // year_month_day_last
209 inline ETL_CONSTEXPR14 etl::chrono::year_month_day_last operator/(int y, const etl::chrono::month_day_last& mdl) ETL_NOEXCEPT
210 {
211 return etl::chrono::year_month_day_last(etl::chrono::year(y), mdl);
212 }
213
214 // year_month_day_last
215 inline ETL_CONSTEXPR14 etl::chrono::year_month_day_last operator/(const etl::chrono::month_day_last& mdl, const etl::chrono::year& y) ETL_NOEXCEPT
216 {
217 return etl::chrono::year_month_day_last(y, mdl);
218 }
219
220 // year_month_day_last
221 inline ETL_CONSTEXPR14 etl::chrono::year_month_day_last operator/(const etl::chrono::month_day_last& mdl, int y) ETL_NOEXCEPT
222 {
223 return etl::chrono::year_month_day_last(etl::chrono::year(y), mdl);
224 }
225
226 //*************************************************************************
227 // year_month_weekday
228 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday operator/(const etl::chrono::year_month& ym, const etl::chrono::weekday_indexed& wdi)
229 ETL_NOEXCEPT
230 {
231 return etl::chrono::year_month_weekday(ym.year(), ym.month(), wdi);
232 }
233
234 // year_month_weekday
235 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday operator/(const etl::chrono::year& y, const etl::chrono::month_weekday& mwd) ETL_NOEXCEPT
236 {
237 return etl::chrono::year_month_weekday(y, mwd.month(), mwd.weekday_indexed());
238 }
239
240 // year_month_weekday
241 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday operator/(int y, const etl::chrono::month_weekday& mwd) ETL_NOEXCEPT
242 {
243 return etl::chrono::year_month_weekday(etl::chrono::year(y), mwd.month(), mwd.weekday_indexed());
244 }
245
246 // year_month_weekday
247 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday operator/(const etl::chrono::month_weekday& mwd, const etl::chrono::year& y) ETL_NOEXCEPT
248 {
249 return etl::chrono::year_month_weekday(y, mwd.month(), mwd.weekday_indexed());
250 }
251
252 // year_month_weekday
253 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday operator/(const etl::chrono::month_weekday& mwd, int y) ETL_NOEXCEPT
254 {
255 return etl::chrono::year_month_weekday(etl::chrono::year(y), mwd.month(), mwd.weekday_indexed());
256 }
257
258 //*************************************************************************
259 // year_month_weekday_last
260 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday_last operator/(const etl::chrono::year_month& ym, const etl::chrono::weekday_last& wdl)
261 ETL_NOEXCEPT
262 {
263 return etl::chrono::year_month_weekday_last(ym.year(), ym.month(), wdl);
264 }
265
266 // year_month_weekday_last
267 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday_last operator/(const etl::chrono::year& y, const etl::chrono::month_weekday_last& mwdl)
268 ETL_NOEXCEPT
269 {
270 return etl::chrono::year_month_weekday_last(y, mwdl.month(), mwdl.weekday_last());
271 }
272
273 // year_month_weekday_last
274 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday_last operator/(int y, const etl::chrono::month_weekday_last& mwdl) ETL_NOEXCEPT
275 {
276 return etl::chrono::year_month_weekday_last(etl::chrono::year(y), mwdl.month(), mwdl.weekday_last());
277 }
278
279 // year_month_weekday_last
280 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday_last operator/(const etl::chrono::month_weekday_last& mwdl, const etl::chrono::year& y)
281 ETL_NOEXCEPT
282 {
283 return etl::chrono::year_month_weekday_last(y, mwdl.month(), mwdl.weekday_last());
284 }
285
286 // year_month_weekday_last
287 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday_last operator/(const etl::chrono::month_weekday_last& mwdl, int y) ETL_NOEXCEPT
288 {
289 return etl::chrono::year_month_weekday_last(etl::chrono::year(y), mwdl.month(), mwdl.weekday_last());
290 }
291 } // namespace chrono
292} // namespace etl
bitset_ext
Definition absolute.h:40