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,
42 const etl::chrono::day& d) ETL_NOEXCEPT
43 {
44 return etl::chrono::month_day(m, d);
45 }
46
47 // month_day
48 inline ETL_CONSTEXPR14 etl::chrono::month_day operator /(const etl::chrono::month& m,
49 int d) ETL_NOEXCEPT
50 {
52 }
53
54 // month_day
55 inline ETL_CONSTEXPR14 etl::chrono::month_day operator /(int m,
56 const etl::chrono::day& d) ETL_NOEXCEPT
57 {
59 }
60
61 // month_day
62 inline ETL_CONSTEXPR14 etl::chrono::month_day operator /(const etl::chrono::day& d,
63 const etl::chrono::month& m) ETL_NOEXCEPT
64 {
65 return etl::chrono::month_day(m, d);
66 }
67
68 // month_day
69 inline ETL_CONSTEXPR14 etl::chrono::month_day operator /(const etl::chrono::day& d,
70 int m) ETL_NOEXCEPT
71 {
73 }
74
75 //*************************************************************************
76 // month_day_last
77 inline ETL_CONSTEXPR14 etl::chrono::month_day_last operator /(const etl::chrono::month& m,
78 etl::chrono::last_spec) ETL_NOEXCEPT
79 {
81 }
82
83 // month_day_last
84 inline ETL_CONSTEXPR14 etl::chrono::month_day_last operator /(int m,
85 etl::chrono::last_spec) ETL_NOEXCEPT
86 {
88 }
89
90 // month_day_last
91 inline ETL_CONSTEXPR14 etl::chrono::month_day_last operator /(etl::chrono::last_spec,
92 const etl::chrono::month& m) ETL_NOEXCEPT
93 {
95 }
96
97 // month_day_last
99 int m) ETL_NOEXCEPT
100 {
102 }
103
104 //*************************************************************************
105 // month_weekday
106 inline ETL_CONSTEXPR14 etl::chrono::month_weekday operator /(const etl::chrono::month& m,
107 const etl::chrono::weekday_indexed& wdi) ETL_NOEXCEPT
108 {
109 return etl::chrono::month_weekday(m, wdi);
110 }
111
112 // month_weekday
113 inline ETL_CONSTEXPR14 etl::chrono::month_weekday operator /(int m,
114 const etl::chrono::weekday_indexed& wdi) ETL_NOEXCEPT
115 {
117 }
118
119 // month_weekday
120 inline ETL_CONSTEXPR14 etl::chrono::month_weekday operator /(const etl::chrono::weekday_indexed& wdi,
121 const etl::chrono::month& m) ETL_NOEXCEPT
122 {
123 return etl::chrono::month_weekday(m, wdi);
124 }
125
126 // month_weekday
127 inline ETL_CONSTEXPR14 etl::chrono::month_weekday operator /(const etl::chrono::weekday_indexed& wdi,
128 int m) ETL_NOEXCEPT
129 {
131 }
132
133 //*************************************************************************
134 // month_weekday_last
135 inline ETL_CONSTEXPR14 etl::chrono::month_weekday_last operator /(const etl::chrono::month& m,
136 const etl::chrono::weekday_last& wdl) ETL_NOEXCEPT
137 {
138 return etl::chrono::month_weekday_last(m, wdl);
139 }
140
141 // month_weekday_last
142 inline ETL_CONSTEXPR14 etl::chrono::month_weekday_last operator /(int m,
143 const etl::chrono::weekday_last& wdl) ETL_NOEXCEPT
144 {
146 }
147
148 // month_weekday_last
149 inline ETL_CONSTEXPR14 etl::chrono::month_weekday_last operator /(const etl::chrono::weekday_last& wdl,
150 const etl::chrono::month& m) ETL_NOEXCEPT
151 {
152 return etl::chrono::month_weekday_last(m, wdl);
153 }
154
155 // month_weekday_last
156 inline ETL_CONSTEXPR14 etl::chrono::month_weekday_last operator /(const etl::chrono::weekday_last& wdl,
157 int m) ETL_NOEXCEPT
158 {
160 }
161
162 //*************************************************************************
163 // year_month
164 inline ETL_CONSTEXPR14 etl::chrono::year_month operator /(const etl::chrono::year& y,
165 const etl::chrono::month& m) ETL_NOEXCEPT
166 {
167 return etl::chrono::year_month(y, m);
168 }
169
170 // year_month
171 inline ETL_CONSTEXPR14 etl::chrono::year_month operator /(const etl::chrono::year& y,
172 int m) ETL_NOEXCEPT
173 {
175 }
176
178 // year_month_day
179 inline ETL_CONSTEXPR14 etl::chrono::year_month_day operator /(const etl::chrono::year_month& ym,
180 const etl::chrono::day& d) ETL_NOEXCEPT
181 {
182 return etl::chrono::year_month_day(ym.year(), ym.month(), d);
183 }
184
185 // year_month_day
186 inline ETL_CONSTEXPR14 etl::chrono::year_month_day operator /(const etl::chrono::year_month& ym,
187 int d ) ETL_NOEXCEPT
188 {
189 return etl::chrono::year_month_day(ym.year(), ym.month(), etl::chrono::day(d));
190 }
191
192 // year_month_day
193 inline ETL_CONSTEXPR14 etl::chrono::year_month_day operator /(const etl::chrono::year& y,
194 const etl::chrono::month_day& md) ETL_NOEXCEPT
195 {
196 return etl::chrono::year_month_day(y, md.month(), md.day());
197 }
198
199 // year_month_day
200 inline ETL_CONSTEXPR14 etl::chrono::year_month_day operator/(int y,
201 const etl::chrono::month_day& md) ETL_NOEXCEPT
202 {
203 return etl::chrono::year_month_day(etl::chrono::year(y), md.month(), md.day());
204 }
205
206 // year_month_day
207 inline ETL_CONSTEXPR14 etl::chrono::year_month_day operator /(const etl::chrono::month_day& md,
208 const etl::chrono::year& y) ETL_NOEXCEPT
209 {
210 return etl::chrono::year_month_day(y, md.month(), md.day());
211 }
212
213 // year_month_day
214 inline ETL_CONSTEXPR14 etl::chrono::year_month_day operator /(const etl::chrono::month_day& md,
215 int y) ETL_NOEXCEPT
216 {
217 return etl::chrono::year_month_day(etl::chrono::year(y), md.month(), md.day());
218 }
219
220 //*************************************************************************
221 // year_month_day_last
222 inline ETL_CONSTEXPR14 etl::chrono::year_month_day_last operator /(const etl::chrono::year_month& ym,
223 etl::chrono::last_spec) ETL_NOEXCEPT
224 {
226 }
227
228 // year_month_day_last
229 inline ETL_CONSTEXPR14 etl::chrono::year_month_day_last operator /(const etl::chrono::year& y,
230 const etl::chrono::month_day_last& mdl) ETL_NOEXCEPT
231 {
233 }
234
235 // year_month_day_last
236 inline ETL_CONSTEXPR14 etl::chrono::year_month_day_last operator /(int y,
237 const etl::chrono::month_day_last& mdl) ETL_NOEXCEPT
238 {
240 }
241
242 // year_month_day_last
243 inline ETL_CONSTEXPR14 etl::chrono::year_month_day_last operator /(const etl::chrono::month_day_last& mdl,
244 const etl::chrono::year& y) ETL_NOEXCEPT
245 {
247 }
248
249 // year_month_day_last
250 inline ETL_CONSTEXPR14 etl::chrono::year_month_day_last operator /(const etl::chrono::month_day_last& mdl,
251 int y) ETL_NOEXCEPT
252 {
254 }
255
256 //*************************************************************************
257 // year_month_weekday
258 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday operator /(const etl::chrono::year_month& ym,
259 const etl::chrono::weekday_indexed& wdi) ETL_NOEXCEPT
260 {
261 return etl::chrono::year_month_weekday(ym.year(), ym.month(), wdi);
262 }
263
264 // year_month_weekday
265 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday operator /(const etl::chrono::year& y,
266 const etl::chrono::month_weekday& mwd) ETL_NOEXCEPT
267 {
268 return etl::chrono::year_month_weekday(y, mwd.month(), mwd.weekday_indexed());
269 }
270
271 // year_month_weekday
272 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday operator/(int y,
273 const etl::chrono::month_weekday& mwd) ETL_NOEXCEPT
274 {
275 return etl::chrono::year_month_weekday(etl::chrono::year(y), mwd.month(), mwd.weekday_indexed());
276 }
277
278 // year_month_weekday
279 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday operator /(const etl::chrono::month_weekday& mwd,
280 const etl::chrono::year& y) ETL_NOEXCEPT
281 {
282 return etl::chrono::year_month_weekday(y, mwd.month(), mwd.weekday_indexed());
283 }
284
285 // year_month_weekday
286 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday operator /(const etl::chrono::month_weekday& mwd,
287 int y) ETL_NOEXCEPT
288 {
289 return etl::chrono::year_month_weekday(etl::chrono::year(y), mwd.month(), mwd.weekday_indexed());
290 }
291
292 //*************************************************************************
293 // year_month_weekday_last
294 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday_last operator /(const etl::chrono::year_month& ym,
295 const etl::chrono::weekday_last& wdl) ETL_NOEXCEPT
296 {
297 return etl::chrono::year_month_weekday_last(ym.year(), ym.month(), wdl);
298 }
299
300 // year_month_weekday_last
301 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday_last operator /(const etl::chrono::year& y,
302 const etl::chrono::month_weekday_last& mwdl) ETL_NOEXCEPT
303 {
304 return etl::chrono::year_month_weekday_last(y, mwdl.month(), mwdl.weekday_last());
305 }
306
307 // year_month_weekday_last
308 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday_last operator/(int y,
309 const etl::chrono::month_weekday_last& mwdl) ETL_NOEXCEPT
310 {
311 return etl::chrono::year_month_weekday_last(etl::chrono::year(y), mwdl.month(), mwdl.weekday_last());
312 }
313
314 // year_month_weekday_last
315 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday_last operator /(const etl::chrono::month_weekday_last& mwdl,
316 const etl::chrono::year& y) ETL_NOEXCEPT
317 {
318 return etl::chrono::year_month_weekday_last(y, mwdl.month(), mwdl.weekday_last());
319 }
320
321 // year_month_weekday_last
322 inline ETL_CONSTEXPR14 etl::chrono::year_month_weekday_last operator /(const etl::chrono::month_weekday_last& mwdl,
323 int y) ETL_NOEXCEPT
324 {
325 return etl::chrono::year_month_weekday_last(etl::chrono::year(y), mwdl.month(), mwdl.weekday_last());
326 }
327 }
328}
day
Definition day.h:43
Spaceship operator.
Definition month_day.h:215
Definition month_day.h:40
Construct from month and weekday_last.
Definition month_weekday.h:109
Definition month_weekday.h:40
month
Definition month.h:54
weekday_indexed
Definition weekday.h:344
weekday_last
Definition weekday.h:439
Spaceship operator.
Definition year_month_day.h:473
year_month_day
Definition year_month_day.h:45
year_month_weekday_last
Definition year_month_weekday.h:289
year_month_weekday
Definition year_month_weekday.h:43
Definition year_month.h:40
year
Definition year.h:43
bitset_ext
Definition absolute.h:38
ETL_CONSTEXPR14 enable_if<!etl::is_specialization< TRep2, etl::chrono::duration >::value, etl::chrono::duration< typenameetl::common_type< TRep1, TRep2 >::type, TPeriod1 > >::type operator/(const etl::chrono::duration< TRep1, TPeriod1 > &lhs, const TRep2 &rhs) ETL_NOEXCEPT
Operator /.
Definition duration.h:576
ETL_NODISCARD ETL_CONSTEXPR14 T round_half_even_unscaled(T value) ETL_NOEXCEPT
Definition scaled_rounding.h:314
Definition last_spec.h:40