NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
iso_week.h
Go to the documentation of this file.
1#ifndef ISO_WEEK_H
2#define ISO_WEEK_H
3
4// The MIT License (MIT)
5//
6// Copyright (c) 2015, 2016, 2017 Howard Hinnant
7//
8// Permission is hereby granted, free of charge, to any person obtaining a copy
9// of this software and associated documentation files (the "Software"), to deal
10// in the Software without restriction, including without limitation the rights
11// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12// copies of the Software, and to permit persons to whom the Software is
13// furnished to do so, subject to the following conditions:
14//
15// The above copyright notice and this permission notice shall be included in all
16// copies or substantial portions of the Software.
17//
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24// SOFTWARE.
25
26#include "date.h"
27
28#include <climits>
29
30namespace iso_week
31{
32
33// y/wn/wd
34// wn/wd/y
35// wd/wn/y
36
40
41// time_point
42
45
46// types
47
49{
50 explicit last_week() = default;
51};
52
53class weekday;
54class weeknum;
55class year;
56
57class year_weeknum;
58class year_lastweek;
59class weeknum_weekday;
61
64
65// date composition operators
66
69
71
76
80
85
88
91
92// weekday
93
95{
96 unsigned char wd_;
97public:
98 explicit CONSTCD11 weekday(unsigned wd) NOEXCEPT;
100 explicit weekday(int) = delete;
102 CONSTCD11 explicit weekday(const local_days& dp) NOEXCEPT;
103
105 weekday operator++(int) NOEXCEPT;
106 weekday& operator--() NOEXCEPT;
107 weekday operator--(int) NOEXCEPT;
108
109 weekday& operator+=(const days& d) NOEXCEPT;
110 weekday& operator-=(const days& d) NOEXCEPT;
111
112 CONSTCD11 explicit operator unsigned() const NOEXCEPT;
113 CONSTCD11 operator date::weekday() const NOEXCEPT;
114 CONSTCD11 bool ok() const NOEXCEPT;
115
116private:
117 static CONSTCD11 unsigned char weekday_from_days(int z) NOEXCEPT;
118 static CONSTCD11 unsigned char to_iso_encoding(unsigned char) NOEXCEPT;
119 static CONSTCD11 unsigned from_iso_encoding(unsigned) NOEXCEPT;
120};
121
122CONSTCD11 bool operator==(const weekday& x, const weekday& y) NOEXCEPT;
123CONSTCD11 bool operator!=(const weekday& x, const weekday& y) NOEXCEPT;
124
125CONSTCD14 weekday operator+(const weekday& x, const days& y) NOEXCEPT;
126CONSTCD14 weekday operator+(const days& x, const weekday& y) NOEXCEPT;
127CONSTCD14 weekday operator-(const weekday& x, const days& y) NOEXCEPT;
128CONSTCD14 days operator-(const weekday& x, const weekday& y) NOEXCEPT;
129
130template<class CharT, class Traits>
131std::basic_ostream<CharT, Traits>&
132operator<<(std::basic_ostream<CharT, Traits>& os, const weekday& wd);
133
134// year
135
136class year
137{
138 short y_;
139
140public:
141 explicit CONSTCD11 year(int y) NOEXCEPT;
142
144 year operator++(int) NOEXCEPT;
145 year& operator--() NOEXCEPT;
146 year operator--(int) NOEXCEPT;
147
148 year& operator+=(const years& y) NOEXCEPT;
149 year& operator-=(const years& y) NOEXCEPT;
150
151 CONSTCD11 explicit operator int() const NOEXCEPT;
152 CONSTCD11 bool ok() const NOEXCEPT;
153
154 static CONSTCD11 year min() NOEXCEPT;
155 static CONSTCD11 year max() NOEXCEPT;
156};
157
158CONSTCD11 bool operator==(const year& x, const year& y) NOEXCEPT;
159CONSTCD11 bool operator!=(const year& x, const year& y) NOEXCEPT;
160CONSTCD11 bool operator< (const year& x, const year& y) NOEXCEPT;
161CONSTCD11 bool operator> (const year& x, const year& y) NOEXCEPT;
162CONSTCD11 bool operator<=(const year& x, const year& y) NOEXCEPT;
163CONSTCD11 bool operator>=(const year& x, const year& y) NOEXCEPT;
164
165CONSTCD11 year operator+(const year& x, const years& y) NOEXCEPT;
166CONSTCD11 year operator+(const years& x, const year& y) NOEXCEPT;
167CONSTCD11 year operator-(const year& x, const years& y) NOEXCEPT;
168CONSTCD11 years operator-(const year& x, const year& y) NOEXCEPT;
169
170template<class CharT, class Traits>
171std::basic_ostream<CharT, Traits>&
172operator<<(std::basic_ostream<CharT, Traits>& os, const year& y);
173
174// weeknum
175
177{
178 unsigned char wn_;
179
180public:
181 explicit CONSTCD11 weeknum(unsigned wn) NOEXCEPT;
182
184 weeknum operator++(int) NOEXCEPT;
185 weeknum& operator--() NOEXCEPT;
186 weeknum operator--(int) NOEXCEPT;
187
188 weeknum& operator+=(const weeks& y) NOEXCEPT;
189 weeknum& operator-=(const weeks& y) NOEXCEPT;
190
191 CONSTCD11 explicit operator unsigned() const NOEXCEPT;
192 CONSTCD11 bool ok() const NOEXCEPT;
193};
194
195CONSTCD11 bool operator==(const weeknum& x, const weeknum& y) NOEXCEPT;
196CONSTCD11 bool operator!=(const weeknum& x, const weeknum& y) NOEXCEPT;
197CONSTCD11 bool operator< (const weeknum& x, const weeknum& y) NOEXCEPT;
198CONSTCD11 bool operator> (const weeknum& x, const weeknum& y) NOEXCEPT;
199CONSTCD11 bool operator<=(const weeknum& x, const weeknum& y) NOEXCEPT;
200CONSTCD11 bool operator>=(const weeknum& x, const weeknum& y) NOEXCEPT;
201
202CONSTCD11 weeknum operator+(const weeknum& x, const weeks& y) NOEXCEPT;
203CONSTCD11 weeknum operator+(const weeks& x, const weeknum& y) NOEXCEPT;
204CONSTCD11 weeknum operator-(const weeknum& x, const weeks& y) NOEXCEPT;
205CONSTCD11 weeks operator-(const weeknum& x, const weeknum& y) NOEXCEPT;
206
207template<class CharT, class Traits>
208std::basic_ostream<CharT, Traits>&
209operator<<(std::basic_ostream<CharT, Traits>& os, const weeknum& wn);
210
211// year_weeknum
212
214{
217
218public:
220
223
224 year_weeknum& operator+=(const years& dy) NOEXCEPT;
225 year_weeknum& operator-=(const years& dy) NOEXCEPT;
226
227 CONSTCD11 bool ok() const NOEXCEPT;
228};
229
230CONSTCD11 bool operator==(const year_weeknum& x, const year_weeknum& y) NOEXCEPT;
231CONSTCD11 bool operator!=(const year_weeknum& x, const year_weeknum& y) NOEXCEPT;
232CONSTCD11 bool operator< (const year_weeknum& x, const year_weeknum& y) NOEXCEPT;
233CONSTCD11 bool operator> (const year_weeknum& x, const year_weeknum& y) NOEXCEPT;
234CONSTCD11 bool operator<=(const year_weeknum& x, const year_weeknum& y) NOEXCEPT;
235CONSTCD11 bool operator>=(const year_weeknum& x, const year_weeknum& y) NOEXCEPT;
236
237CONSTCD11 year_weeknum operator+(const year_weeknum& ym, const years& dy) NOEXCEPT;
238CONSTCD11 year_weeknum operator+(const years& dy, const year_weeknum& ym) NOEXCEPT;
239CONSTCD11 year_weeknum operator-(const year_weeknum& ym, const years& dy) NOEXCEPT;
240
241template<class CharT, class Traits>
242std::basic_ostream<CharT, Traits>&
243operator<<(std::basic_ostream<CharT, Traits>& os, const year_weeknum& ym);
244
245// year_lastweek
246
248{
250
251public:
253
256
257 year_lastweek& operator+=(const years& dy) NOEXCEPT;
258 year_lastweek& operator-=(const years& dy) NOEXCEPT;
259
260 CONSTCD11 bool ok() const NOEXCEPT;
261};
262
263CONSTCD11 bool operator==(const year_lastweek& x, const year_lastweek& y) NOEXCEPT;
264CONSTCD11 bool operator!=(const year_lastweek& x, const year_lastweek& y) NOEXCEPT;
265CONSTCD11 bool operator< (const year_lastweek& x, const year_lastweek& y) NOEXCEPT;
266CONSTCD11 bool operator> (const year_lastweek& x, const year_lastweek& y) NOEXCEPT;
267CONSTCD11 bool operator<=(const year_lastweek& x, const year_lastweek& y) NOEXCEPT;
268CONSTCD11 bool operator>=(const year_lastweek& x, const year_lastweek& y) NOEXCEPT;
269
270CONSTCD11 year_lastweek operator+(const year_lastweek& ym, const years& dy) NOEXCEPT;
271CONSTCD11 year_lastweek operator+(const years& dy, const year_lastweek& ym) NOEXCEPT;
272CONSTCD11 year_lastweek operator-(const year_lastweek& ym, const years& dy) NOEXCEPT;
273
274template<class CharT, class Traits>
275std::basic_ostream<CharT, Traits>&
276operator<<(std::basic_ostream<CharT, Traits>& os, const year_lastweek& ym);
277
278// weeknum_weekday
279
281{
284
285public:
287 const iso_week::weekday& wd) NOEXCEPT;
288
291
292 CONSTCD14 bool ok() const NOEXCEPT;
293};
294
295CONSTCD11 bool operator==(const weeknum_weekday& x, const weeknum_weekday& y) NOEXCEPT;
296CONSTCD11 bool operator!=(const weeknum_weekday& x, const weeknum_weekday& y) NOEXCEPT;
297CONSTCD11 bool operator< (const weeknum_weekday& x, const weeknum_weekday& y) NOEXCEPT;
298CONSTCD11 bool operator> (const weeknum_weekday& x, const weeknum_weekday& y) NOEXCEPT;
299CONSTCD11 bool operator<=(const weeknum_weekday& x, const weeknum_weekday& y) NOEXCEPT;
300CONSTCD11 bool operator>=(const weeknum_weekday& x, const weeknum_weekday& y) NOEXCEPT;
301
302template<class CharT, class Traits>
303std::basic_ostream<CharT, Traits>&
304operator<<(std::basic_ostream<CharT, Traits>& os, const weeknum_weekday& md);
305
306// lastweek_weekday
307
309{
311
312public:
314
316
317 CONSTCD14 bool ok() const NOEXCEPT;
318};
319
320CONSTCD11 bool operator==(const lastweek_weekday& x, const lastweek_weekday& y) NOEXCEPT;
321CONSTCD11 bool operator!=(const lastweek_weekday& x, const lastweek_weekday& y) NOEXCEPT;
322CONSTCD11 bool operator< (const lastweek_weekday& x, const lastweek_weekday& y) NOEXCEPT;
323CONSTCD11 bool operator> (const lastweek_weekday& x, const lastweek_weekday& y) NOEXCEPT;
324CONSTCD11 bool operator<=(const lastweek_weekday& x, const lastweek_weekday& y) NOEXCEPT;
325CONSTCD11 bool operator>=(const lastweek_weekday& x, const lastweek_weekday& y) NOEXCEPT;
326
327template<class CharT, class Traits>
328std::basic_ostream<CharT, Traits>&
329operator<<(std::basic_ostream<CharT, Traits>& os, const lastweek_weekday& md);
330
331// year_lastweek_weekday
332
334{
337
338public:
340 const iso_week::weekday& wd) NOEXCEPT;
341
344
348
349 CONSTCD14 operator sys_days() const NOEXCEPT;
350 CONSTCD14 explicit operator local_days() const NOEXCEPT;
351 CONSTCD11 bool ok() const NOEXCEPT;
352};
353
354CONSTCD11 bool operator==(const year_lastweek_weekday& x, const year_lastweek_weekday& y) NOEXCEPT;
355CONSTCD11 bool operator!=(const year_lastweek_weekday& x, const year_lastweek_weekday& y) NOEXCEPT;
356CONSTCD11 bool operator< (const year_lastweek_weekday& x, const year_lastweek_weekday& y) NOEXCEPT;
357CONSTCD11 bool operator> (const year_lastweek_weekday& x, const year_lastweek_weekday& y) NOEXCEPT;
358CONSTCD11 bool operator<=(const year_lastweek_weekday& x, const year_lastweek_weekday& y) NOEXCEPT;
359CONSTCD11 bool operator>=(const year_lastweek_weekday& x, const year_lastweek_weekday& y) NOEXCEPT;
360
361CONSTCD11 year_lastweek_weekday operator+(const year_lastweek_weekday& ywnwd, const years& y) NOEXCEPT;
362CONSTCD11 year_lastweek_weekday operator+(const years& y, const year_lastweek_weekday& ywnwd) NOEXCEPT;
363CONSTCD11 year_lastweek_weekday operator-(const year_lastweek_weekday& ywnwd, const years& y) NOEXCEPT;
364
365template<class CharT, class Traits>
366std::basic_ostream<CharT, Traits>&
367operator<<(std::basic_ostream<CharT, Traits>& os, const year_lastweek_weekday& ywnwd);
368
369// class year_weeknum_weekday
370
372{
376
377public:
379 const iso_week::weekday& wd) NOEXCEPT;
383
386
390
391 CONSTCD14 operator sys_days() const NOEXCEPT;
392 CONSTCD14 explicit operator local_days() const NOEXCEPT;
393 CONSTCD14 bool ok() const NOEXCEPT;
394
395private:
396 static CONSTCD14 year_weeknum_weekday from_days(days dp) NOEXCEPT;
397};
398
399CONSTCD11 bool operator==(const year_weeknum_weekday& x, const year_weeknum_weekday& y) NOEXCEPT;
400CONSTCD11 bool operator!=(const year_weeknum_weekday& x, const year_weeknum_weekday& y) NOEXCEPT;
401CONSTCD11 bool operator< (const year_weeknum_weekday& x, const year_weeknum_weekday& y) NOEXCEPT;
402CONSTCD11 bool operator> (const year_weeknum_weekday& x, const year_weeknum_weekday& y) NOEXCEPT;
403CONSTCD11 bool operator<=(const year_weeknum_weekday& x, const year_weeknum_weekday& y) NOEXCEPT;
404CONSTCD11 bool operator>=(const year_weeknum_weekday& x, const year_weeknum_weekday& y) NOEXCEPT;
405
406CONSTCD11 year_weeknum_weekday operator+(const year_weeknum_weekday& ywnwd, const years& y) NOEXCEPT;
407CONSTCD11 year_weeknum_weekday operator+(const years& y, const year_weeknum_weekday& ywnwd) NOEXCEPT;
408CONSTCD11 year_weeknum_weekday operator-(const year_weeknum_weekday& ywnwd, const years& y) NOEXCEPT;
409
410template<class CharT, class Traits>
411std::basic_ostream<CharT, Traits>&
412operator<<(std::basic_ostream<CharT, Traits>& os, const year_weeknum_weekday& ywnwd);
413
414//----------------+
415// Implementation |
416//----------------+
417
418// weekday
419
421inline
422unsigned char
424{
425 return z != 0 ? z : (unsigned char)7;
426}
427
429inline
430unsigned
432{
433 return z != 7 ? z : 0u;
434}
435
437inline
438unsigned char
440{
441 return to_iso_encoding(static_cast<unsigned char>(static_cast<unsigned>(
442 z >= -4 ? (z+4) % 7 : (z+5) % 7 + 6)));
443}
444
446inline
448 : wd_(static_cast<decltype(wd_)>(wd))
449 {}
450
452inline
454 : wd_(wd.iso_encoding())
455 {}
456
458inline
460 : wd_(weekday_from_days(dp.time_since_epoch().count()))
461 {}
462
464inline
466 : wd_(weekday_from_days(dp.time_since_epoch().count()))
467 {}
468
469inline weekday& weekday::operator++() NOEXCEPT {if (++wd_ == 8) wd_ = 1; return *this;}
470inline weekday weekday::operator++(int) NOEXCEPT {auto tmp(*this); ++(*this); return tmp;}
471inline weekday& weekday::operator--() NOEXCEPT {if (wd_-- == 1) wd_ = 7; return *this;}
472inline weekday weekday::operator--(int) NOEXCEPT {auto tmp(*this); --(*this); return tmp;}
473
474inline
475weekday&
477{
478 *this = *this + d;
479 return *this;
480}
481
482inline
483weekday&
485{
486 *this = *this - d;
487 return *this;
488}
489
491inline
492weekday::operator unsigned() const NOEXCEPT
493{
494 return wd_;
495}
496
498inline
499weekday::operator date::weekday() const NOEXCEPT
500{
501 return date::weekday{from_iso_encoding(unsigned{wd_})};
502}
503
504CONSTCD11 inline bool weekday::ok() const NOEXCEPT {return 1 <= wd_ && wd_ <= 7;}
505
507inline
508bool
510{
511 return static_cast<unsigned>(x) == static_cast<unsigned>(y);
512}
513
515inline
516bool
518{
519 return !(x == y);
520}
521
523inline
524days
526{
527 auto const diff = static_cast<unsigned>(x) - static_cast<unsigned>(y);
528 return days{diff <= 6 ? diff : diff + 7};
529}
530
532inline
534operator+(const weekday& x, const days& y) NOEXCEPT
535{
536 auto const wdu = static_cast<long long>(static_cast<unsigned>(x) - 1u) + y.count();
537 auto const wk = (wdu >= 0 ? wdu : wdu-6) / 7;
538 return weekday{static_cast<unsigned>(wdu - wk * 7) + 1u};
539}
540
542inline
544operator+(const days& x, const weekday& y) NOEXCEPT
545{
546 return y + x;
547}
548
550inline
552operator-(const weekday& x, const days& y) NOEXCEPT
553{
554 return x + -y;
555}
556
557template<class CharT, class Traits>
558inline
559std::basic_ostream<CharT, Traits>&
560operator<<(std::basic_ostream<CharT, Traits>& os, const weekday& wd)
561{
562 switch (static_cast<unsigned>(wd))
563 {
564 case 7:
565 os << "Sun";
566 break;
567 case 1:
568 os << "Mon";
569 break;
570 case 2:
571 os << "Tue";
572 break;
573 case 3:
574 os << "Wed";
575 break;
576 case 4:
577 os << "Thu";
578 break;
579 case 5:
580 os << "Fri";
581 break;
582 case 6:
583 os << "Sat";
584 break;
585 default:
586 os << static_cast<unsigned>(wd) << " is not a valid weekday";
587 break;
588 }
589 return os;
590}
591
592// year
593
594CONSTCD11 inline year::year(int y) NOEXCEPT : y_(static_cast<decltype(y_)>(y)) {}
595inline year& year::operator++() NOEXCEPT {++y_; return *this;}
596inline year year::operator++(int) NOEXCEPT {auto tmp(*this); ++(*this); return tmp;}
597inline year& year::operator--() NOEXCEPT {--y_; return *this;}
598inline year year::operator--(int) NOEXCEPT {auto tmp(*this); --(*this); return tmp;}
599inline year& year::operator+=(const years& y) NOEXCEPT {*this = *this + y; return *this;}
600inline year& year::operator-=(const years& y) NOEXCEPT {*this = *this - y; return *this;}
601
602CONSTCD11 inline year::operator int() const NOEXCEPT {return y_;}
603CONSTCD11 inline bool year::ok() const NOEXCEPT {return min() <= *this && *this <= max();}
604
606inline
607year
609{
610 using std::chrono::seconds;
611 using std::chrono::minutes;
612 using std::chrono::hours;
613 using std::chrono::duration_cast;
614 static_assert(sizeof(seconds)*CHAR_BIT >= 41, "seconds may overflow");
615 static_assert(sizeof(hours)*CHAR_BIT >= 30, "hours may overflow");
616 return sizeof(minutes)*CHAR_BIT < 34 ?
617 year{1970} + duration_cast<years>(minutes::min()) :
619}
620
622inline
623year
625{
626 using std::chrono::seconds;
627 using std::chrono::minutes;
628 using std::chrono::hours;
629 using std::chrono::duration_cast;
630 static_assert(sizeof(seconds)*CHAR_BIT >= 41, "seconds may overflow");
631 static_assert(sizeof(hours)*CHAR_BIT >= 30, "hours may overflow");
632 return sizeof(minutes)*CHAR_BIT < 34 ?
633 year{1969} + duration_cast<years>(minutes::max()) :
635}
636
638inline
639bool
640operator==(const year& x, const year& y) NOEXCEPT
641{
642 return static_cast<int>(x) == static_cast<int>(y);
643}
644
646inline
647bool
648operator!=(const year& x, const year& y) NOEXCEPT
649{
650 return !(x == y);
651}
652
654inline
655bool
656operator<(const year& x, const year& y) NOEXCEPT
657{
658 return static_cast<int>(x) < static_cast<int>(y);
659}
660
662inline
663bool
664operator>(const year& x, const year& y) NOEXCEPT
665{
666 return y < x;
667}
668
670inline
671bool
672operator<=(const year& x, const year& y) NOEXCEPT
673{
674 return !(y < x);
675}
676
678inline
679bool
680operator>=(const year& x, const year& y) NOEXCEPT
681{
682 return !(x < y);
683}
684
686inline
687years
688operator-(const year& x, const year& y) NOEXCEPT
689{
690 return years{static_cast<int>(x) - static_cast<int>(y)};
691}
692
694inline
695year
696operator+(const year& x, const years& y) NOEXCEPT
697{
698 return year{static_cast<int>(x) + y.count()};
699}
700
702inline
703year
704operator+(const years& x, const year& y) NOEXCEPT
705{
706 return y + x;
707}
708
710inline
711year
712operator-(const year& x, const years& y) NOEXCEPT
713{
714 return year{static_cast<int>(x) - y.count()};
715}
716
717template<class CharT, class Traits>
718inline
719std::basic_ostream<CharT, Traits>&
720operator<<(std::basic_ostream<CharT, Traits>& os, const year& y)
721{
723 os.fill('0');
724 os.flags(std::ios::dec | std::ios::internal);
725 os.width(4 + (y < year{0}));
726 os << static_cast<int>(y);
727 return os;
728}
729
730#if !defined(_MSC_VER) || (_MSC_VER >= 1900)
731inline namespace literals
732{
733
735inline
737operator "" _y(unsigned long long y) NOEXCEPT
738{
739 return iso_week::year(static_cast<int>(y));
740}
741
743inline
745operator "" _w(unsigned long long wn) NOEXCEPT
746{
747 return iso_week::weeknum(static_cast<unsigned>(wn));
748}
749
750#endif // !defined(_MSC_VER) || (_MSC_VER >= 1900)
751
753
761
762#if !defined(_MSC_VER) || (_MSC_VER >= 1900)
763} // inline namespace literals
764#endif
765
766// weeknum
767
769inline
771 : wn_(static_cast<decltype(wn_)>(wn))
772 {}
773
774inline weeknum& weeknum::operator++() NOEXCEPT {++wn_; return *this;}
775inline weeknum weeknum::operator++(int) NOEXCEPT {auto tmp(*this); ++(*this); return tmp;}
776inline weeknum& weeknum::operator--() NOEXCEPT {--wn_; return *this;}
777inline weeknum weeknum::operator--(int) NOEXCEPT {auto tmp(*this); --(*this); return tmp;}
778
779inline
780weeknum&
782{
783 *this = *this + y;
784 return *this;
785}
786
787inline
788weeknum&
790{
791 *this = *this - y;
792 return *this;
793}
794
795CONSTCD11 inline weeknum::operator unsigned() const NOEXCEPT {return wn_;}
796CONSTCD11 inline bool weeknum::ok() const NOEXCEPT {return 1 <= wn_ && wn_ <= 53;}
797
799inline
800bool
802{
803 return static_cast<unsigned>(x) == static_cast<unsigned>(y);
804}
805
807inline
808bool
810{
811 return !(x == y);
812}
813
815inline
816bool
817operator<(const weeknum& x, const weeknum& y) NOEXCEPT
818{
819 return static_cast<unsigned>(x) < static_cast<unsigned>(y);
820}
821
823inline
824bool
826{
827 return y < x;
828}
829
831inline
832bool
833operator<=(const weeknum& x, const weeknum& y) NOEXCEPT
834{
835 return !(y < x);
836}
837
839inline
840bool
842{
843 return !(x < y);
844}
845
847inline
848weeks
850{
851 return weeks{static_cast<weeks::rep>(static_cast<unsigned>(x)) -
852 static_cast<weeks::rep>(static_cast<unsigned>(y))};
853}
854
856inline
857weeknum
858operator+(const weeknum& x, const weeks& y) NOEXCEPT
859{
860 return weeknum{static_cast<unsigned>(x) + static_cast<unsigned>(y.count())};
861}
862
864inline
865weeknum
866operator+(const weeks& x, const weeknum& y) NOEXCEPT
867{
868 return y + x;
869}
870
872inline
873weeknum
874operator-(const weeknum& x, const weeks& y) NOEXCEPT
875{
876 return x + -y;
877}
878
879template<class CharT, class Traits>
880inline
881std::basic_ostream<CharT, Traits>&
882operator<<(std::basic_ostream<CharT, Traits>& os, const weeknum& wn)
883{
885 os << 'W';
886 os.fill('0');
887 os.flags(std::ios::dec | std::ios::right);
888 os.width(2);
889 os << static_cast<unsigned>(wn);
890 return os;
891}
892
893// year_weeknum
894
896inline
898 : y_(y)
899 , wn_(wn)
900 {}
901
902CONSTCD11 inline year year_weeknum::year() const NOEXCEPT {return y_;}
905{
906 return y_.ok() && 1u <= static_cast<unsigned>(wn_) && wn_ <= (y_/last).weeknum();
907}
908
909inline
912{
913 *this = *this + dy;
914 return *this;
915}
916
917inline
920{
921 *this = *this - dy;
922 return *this;
923}
924
926inline
927bool
929{
930 return x.year() == y.year() && x.weeknum() == y.weeknum();
931}
932
934inline
935bool
937{
938 return !(x == y);
939}
940
942inline
943bool
945{
946 return x.year() < y.year() ? true
947 : (x.year() > y.year() ? false
948 : (x.weeknum() < y.weeknum()));
949}
950
952inline
953bool
955{
956 return y < x;
957}
958
960inline
961bool
963{
964 return !(y < x);
965}
966
968inline
969bool
971{
972 return !(x < y);
973}
974
976inline
977year_weeknum
979{
980 return (ym.year() + dy) / ym.weeknum();
981}
982
984inline
985year_weeknum
987{
988 return ym + dy;
989}
990
992inline
993year_weeknum
995{
996 return ym + -dy;
997}
998
999template<class CharT, class Traits>
1000inline
1001std::basic_ostream<CharT, Traits>&
1002operator<<(std::basic_ostream<CharT, Traits>& os, const year_weeknum& ywn)
1003{
1004 return os << ywn.year() << '-' << ywn.weeknum();
1005}
1006
1007
1008// year_lastweek
1009
1011inline
1013 : y_(y)
1014 {}
1015
1016CONSTCD11 inline year year_lastweek::year() const NOEXCEPT {return y_;}
1017
1019inline
1020weeknum
1022{
1023 const auto y = date::year{static_cast<int>(y_)};
1024 const auto s0 = sys_days((y-years{1})/12/date::thu[date::last]);
1025 const auto s1 = sys_days(y/12/date::thu[date::last]);
1026 return iso_week::weeknum(static_cast<unsigned>(date::trunc<weeks>(s1-s0).count()));
1027}
1028
1029CONSTCD11 inline bool year_lastweek::ok() const NOEXCEPT {return y_.ok();}
1030
1031inline
1034{
1035 *this = *this + dy;
1036 return *this;
1037}
1038
1039inline
1042{
1043 *this = *this - dy;
1044 return *this;
1045}
1046
1048inline
1049bool
1051{
1052 return x.year() == y.year();
1053}
1054
1056inline
1057bool
1059{
1060 return !(x == y);
1061}
1062
1064inline
1065bool
1067{
1068 return x.year() < y.year();
1069}
1070
1072inline
1073bool
1075{
1076 return y < x;
1077}
1078
1080inline
1081bool
1083{
1084 return !(y < x);
1085}
1086
1088inline
1089bool
1091{
1092 return !(x < y);
1093}
1094
1096inline
1097year_lastweek
1099{
1100 return year_lastweek{ym.year() + dy};
1101}
1102
1104inline
1105year_lastweek
1107{
1108 return ym + dy;
1109}
1110
1112inline
1113year_lastweek
1115{
1116 return ym + -dy;
1117}
1118
1119template<class CharT, class Traits>
1120inline
1121std::basic_ostream<CharT, Traits>&
1122operator<<(std::basic_ostream<CharT, Traits>& os, const year_lastweek& ywn)
1123{
1124 return os << ywn.year() << "-W last";
1125}
1126
1127// weeknum_weekday
1128
1130inline
1132 const iso_week::weekday& wd) NOEXCEPT
1133 : wn_(wn)
1134 , wd_(wd)
1135 {}
1136
1139
1141inline
1142bool
1144{
1145 return wn_.ok() && wd_.ok();
1146}
1147
1149inline
1150bool
1152{
1153 return x.weeknum() == y.weeknum() && x.weekday() == y.weekday();
1154}
1155
1157inline
1158bool
1160{
1161 return !(x == y);
1162}
1163
1165inline
1166bool
1168{
1169 return x.weeknum() < y.weeknum() ? true
1170 : (x.weeknum() > y.weeknum() ? false
1171 : (static_cast<unsigned>(x.weekday()) < static_cast<unsigned>(y.weekday())));
1172}
1173
1175inline
1176bool
1178{
1179 return y < x;
1180}
1181
1183inline
1184bool
1186{
1187 return !(y < x);
1188}
1189
1191inline
1192bool
1194{
1195 return !(x < y);
1196}
1197
1198template<class CharT, class Traits>
1199inline
1200std::basic_ostream<CharT, Traits>&
1201operator<<(std::basic_ostream<CharT, Traits>& os, const weeknum_weekday& md)
1202{
1203 return os << md.weeknum() << '-' << md.weekday();
1204}
1205
1206// lastweek_weekday
1207
1209inline
1211 : wd_(wd)
1212 {}
1213
1215
1217inline
1218bool
1220{
1221 return wd_.ok();
1222}
1223
1225inline
1226bool
1228{
1229 return x.weekday() == y.weekday();
1230}
1231
1233inline
1234bool
1236{
1237 return !(x == y);
1238}
1239
1241inline
1242bool
1244{
1245 return static_cast<unsigned>(x.weekday()) < static_cast<unsigned>(y.weekday());
1246}
1247
1249inline
1250bool
1252{
1253 return y < x;
1254}
1255
1257inline
1258bool
1260{
1261 return !(y < x);
1262}
1263
1265inline
1266bool
1268{
1269 return !(x < y);
1270}
1271
1272template<class CharT, class Traits>
1273inline
1274std::basic_ostream<CharT, Traits>&
1275operator<<(std::basic_ostream<CharT, Traits>& os, const lastweek_weekday& md)
1276{
1277 return os << "W last-" << md.weekday();
1278}
1279
1280// year_lastweek_weekday
1281
1283inline
1285 const iso_week::weekday& wd) NOEXCEPT
1286 : y_(y)
1287 , wd_(wd)
1288 {}
1289
1290inline
1293{
1294 *this = *this + y;
1295 return *this;
1296}
1297
1298inline
1301{
1302 *this = *this - y;
1303 return *this;
1304}
1305
1307
1309inline
1310weeknum
1312{
1313 return (y_ / last).weeknum();
1314}
1315
1317
1319inline
1320year_lastweek_weekday::operator sys_days() const NOEXCEPT
1321{
1322 return sys_days(date::year{static_cast<int>(y_)}/date::dec/date::thu[date::last])
1323 + (sun - thu) - (sun - wd_);
1324}
1325
1327inline
1328year_lastweek_weekday::operator local_days() const NOEXCEPT
1329{
1330 return local_days(date::year{static_cast<int>(y_)}/date::dec/date::thu[date::last])
1331 + (sun - thu) - (sun - wd_);
1332}
1333
1335inline
1336bool
1338{
1339 return y_.ok() && wd_.ok();
1340}
1341
1343inline
1344bool
1346{
1347 return x.year() == y.year() && x.weekday() == y.weekday();
1348}
1349
1351inline
1352bool
1354{
1355 return !(x == y);
1356}
1357
1359inline
1360bool
1362{
1363 return x.year() < y.year() ? true
1364 : (x.year() > y.year() ? false
1365 : (static_cast<unsigned>(x.weekday()) < static_cast<unsigned>(y.weekday())));
1366}
1367
1369inline
1370bool
1372{
1373 return y < x;
1374}
1375
1377inline
1378bool
1380{
1381 return !(y < x);
1382}
1383
1385inline
1386bool
1388{
1389 return !(x < y);
1390}
1391
1393inline
1394year_lastweek_weekday
1396{
1397 return (ywnwd.year() + y) / last / ywnwd.weekday();
1398}
1399
1401inline
1402year_lastweek_weekday
1404{
1405 return ywnwd + y;
1406}
1407
1409inline
1410year_lastweek_weekday
1412{
1413 return ywnwd + -y;
1414}
1415
1416template<class CharT, class Traits>
1417inline
1418std::basic_ostream<CharT, Traits>&
1419operator<<(std::basic_ostream<CharT, Traits>& os, const year_lastweek_weekday& ywnwd)
1420{
1421 return os << ywnwd.year() << "-W last-" << ywnwd.weekday();
1422}
1423
1424// year_weeknum_weekday
1425
1427inline
1429 const iso_week::weeknum& wn,
1430 const iso_week::weekday& wd) NOEXCEPT
1431 : y_(y)
1432 , wn_(wn)
1433 , wd_(wd)
1434 {}
1435
1437inline
1439 : y_(ylwwd.year())
1440 , wn_(ylwwd.weeknum())
1441 , wd_(ylwwd.weekday())
1442 {}
1443
1445inline
1447 : year_weeknum_weekday(from_days(dp.time_since_epoch()))
1448 {}
1449
1451inline
1453 : year_weeknum_weekday(from_days(dp.time_since_epoch()))
1454 {}
1455
1456inline
1459{
1460 *this = *this + y;
1461 return *this;
1462}
1463
1464inline
1467{
1468 *this = *this - y;
1469 return *this;
1470}
1471
1475
1477inline
1478year_weeknum_weekday::operator sys_days() const NOEXCEPT
1479{
1480 return sys_days(date::year{static_cast<int>(y_)-1}/date::dec/date::thu[date::last])
1481 + (date::mon - date::thu) + weeks{static_cast<unsigned>(wn_)-1} + (wd_ - mon);
1482}
1483
1485inline
1486year_weeknum_weekday::operator local_days() const NOEXCEPT
1487{
1488 return local_days(date::year{static_cast<int>(y_)-1}/date::dec/date::thu[date::last])
1489 + (date::mon - date::thu) + weeks{static_cast<unsigned>(wn_)-1} + (wd_ - mon);
1490}
1491
1493inline
1494bool
1496{
1497 return y_.ok() && wd_.ok() && iso_week::weeknum{1u} <= wn_ && wn_ <= year_lastweek{y_}.weeknum();
1498}
1499
1501inline
1504{
1505 const auto dp = sys_days{d};
1506 const auto wd = iso_week::weekday{dp};
1507 auto y = date::year_month_day{dp + days{3}}.year();
1508 auto start = sys_days((y - date::years{1})/date::dec/date::thu[date::last]) + (mon-thu);
1509 if (dp < start)
1510 {
1511 --y;
1512 start = sys_days((y - date::years{1})/date::dec/date::thu[date::last]) + (mon-thu);
1513 }
1514 const auto wn = iso_week::weeknum(
1515 static_cast<unsigned>(date::trunc<weeks>(dp - start).count() + 1));
1516 return {iso_week::year(static_cast<int>(y)), wn, wd};
1517}
1518
1520inline
1521bool
1523{
1524 return x.year() == y.year() && x.weeknum() == y.weeknum() && x.weekday() == y.weekday();
1525}
1526
1528inline
1529bool
1531{
1532 return !(x == y);
1533}
1534
1536inline
1537bool
1539{
1540 return x.year() < y.year() ? true
1541 : (x.year() > y.year() ? false
1542 : (x.weeknum() < y.weeknum() ? true
1543 : (x.weeknum() > y.weeknum() ? false
1544 : (static_cast<unsigned>(x.weekday()) < static_cast<unsigned>(y.weekday())))));
1545}
1546
1548inline
1549bool
1551{
1552 return y < x;
1553}
1554
1556inline
1557bool
1559{
1560 return !(y < x);
1561}
1562
1564inline
1565bool
1567{
1568 return !(x < y);
1569}
1570
1572inline
1573year_weeknum_weekday
1575{
1576 return (ywnwd.year() + y) / ywnwd.weeknum() / ywnwd.weekday();
1577}
1578
1580inline
1581year_weeknum_weekday
1583{
1584 return ywnwd + y;
1585}
1586
1588inline
1589year_weeknum_weekday
1591{
1592 return ywnwd + -y;
1593}
1594
1595template<class CharT, class Traits>
1596inline
1597std::basic_ostream<CharT, Traits>&
1598operator<<(std::basic_ostream<CharT, Traits>& os, const year_weeknum_weekday& ywnwd)
1599{
1600 return os << ywnwd.year() << '-' << ywnwd.weeknum() << '-' << ywnwd.weekday();
1601}
1602
1603// date composition operators
1604
1606inline
1607year_weeknum
1608operator/(const year& y, const weeknum& wn) NOEXCEPT
1609{
1610 return {y, wn};
1611}
1612
1614inline
1615year_weeknum
1616operator/(const year& y, int wn) NOEXCEPT
1617{
1618 return y/weeknum(static_cast<unsigned>(wn));
1619}
1620
1622inline
1623year_lastweek
1625{
1626 return year_lastweek{y};
1627}
1628
1630inline
1631weeknum_weekday
1632operator/(const weeknum& wn, const weekday& wd) NOEXCEPT
1633{
1634 return {wn, wd};
1635}
1636
1638inline
1639weeknum_weekday
1640operator/(const weeknum& wn, int wd) NOEXCEPT
1641{
1642 return wn/weekday{static_cast<unsigned>(wd)};
1643}
1644
1646inline
1647weeknum_weekday
1648operator/(const weekday& wd, const weeknum& wn) NOEXCEPT
1649{
1650 return wn/wd;
1651}
1652
1654inline
1655weeknum_weekday
1656operator/(const weekday& wd, int wn) NOEXCEPT
1657{
1658 return weeknum{static_cast<unsigned>(wn)}/wd;
1659}
1660
1662inline
1663lastweek_weekday
1665{
1666 return lastweek_weekday{wd};
1667}
1668
1670inline
1671lastweek_weekday
1672operator/(const last_week& wn, int wd) NOEXCEPT
1673{
1674 return wn / weekday{static_cast<unsigned>(wd)};
1675}
1676
1678inline
1679lastweek_weekday
1681{
1682 return wn / wd;
1683}
1684
1686inline
1687year_weeknum_weekday
1689{
1690 return {ywn.year(), ywn.weeknum(), wd};
1691}
1692
1694inline
1695year_weeknum_weekday
1697{
1698 return ywn / weekday(static_cast<unsigned>(wd));
1699}
1700
1702inline
1703year_weeknum_weekday
1705{
1706 return {y, wnwd.weeknum(), wnwd.weekday()};
1707}
1708
1710inline
1711year_weeknum_weekday
1713{
1714 return wnwd / year{y};
1715}
1716
1718inline
1719year_lastweek_weekday
1721{
1722 return {ylw.year(), wd};
1723}
1724
1726inline
1727year_lastweek_weekday
1729{
1730 return ylw / weekday(static_cast<unsigned>(wd));
1731}
1732
1734inline
1735year_lastweek_weekday
1737{
1738 return {y, lwwd.weekday()};
1739}
1740
1742inline
1743year_lastweek_weekday
1745{
1746 return lwwd / year{y};
1747}
1748
1749} // namespace iso_week
1750
1751#endif // ISO_WEEK_H
CONSTCD11 date::year year() const NOEXCEPT
Definition: date.h:2928
CONSTCD11 lastweek_weekday(const iso_week::weekday &wd) NOEXCEPT
Definition: iso_week.h:1210
iso_week::weekday wd_
Definition: iso_week.h:310
CONSTCD14 bool ok() const NOEXCEPT
Definition: iso_week.h:1219
CONSTCD11 iso_week::weekday weekday() const NOEXCEPT
Definition: iso_week.h:1214
static CONSTCD11 unsigned char weekday_from_days(int z) NOEXCEPT
Definition: iso_week.h:439
weekday & operator-=(const days &d) NOEXCEPT
Definition: iso_week.h:484
weekday(int)=delete
unsigned char wd_
Definition: iso_week.h:96
weekday & operator++() NOEXCEPT
Definition: iso_week.h:469
weekday & operator--() NOEXCEPT
Definition: iso_week.h:471
CONSTCD11 bool ok() const NOEXCEPT
Definition: iso_week.h:504
weekday & operator+=(const days &d) NOEXCEPT
Definition: iso_week.h:476
static CONSTCD11 unsigned char to_iso_encoding(unsigned char) NOEXCEPT
Definition: iso_week.h:423
CONSTCD11 weekday(unsigned wd) NOEXCEPT
Definition: iso_week.h:447
static CONSTCD11 unsigned from_iso_encoding(unsigned) NOEXCEPT
Definition: iso_week.h:431
CONSTCD11 iso_week::weeknum weeknum() const NOEXCEPT
Definition: iso_week.h:1137
CONSTCD14 bool ok() const NOEXCEPT
Definition: iso_week.h:1143
CONSTCD11 weeknum_weekday(const iso_week::weeknum &wn, const iso_week::weekday &wd) NOEXCEPT
Definition: iso_week.h:1131
iso_week::weekday wd_
Definition: iso_week.h:283
iso_week::weeknum wn_
Definition: iso_week.h:282
CONSTCD11 iso_week::weekday weekday() const NOEXCEPT
Definition: iso_week.h:1138
weeknum & operator--() NOEXCEPT
Definition: iso_week.h:776
weeknum & operator++() NOEXCEPT
Definition: iso_week.h:774
weeknum & operator+=(const weeks &y) NOEXCEPT
Definition: iso_week.h:781
CONSTCD11 weeknum(unsigned wn) NOEXCEPT
Definition: iso_week.h:770
weeknum & operator-=(const weeks &y) NOEXCEPT
Definition: iso_week.h:789
CONSTCD11 bool ok() const NOEXCEPT
Definition: iso_week.h:796
unsigned char wn_
Definition: iso_week.h:178
CONSTCD11 iso_week::weekday weekday() const NOEXCEPT
Definition: iso_week.h:1316
CONSTCD11 bool ok() const NOEXCEPT
Definition: iso_week.h:1337
year_lastweek_weekday & operator-=(const years &y) NOEXCEPT
Definition: iso_week.h:1300
CONSTCD11 iso_week::year year() const NOEXCEPT
Definition: iso_week.h:1306
CONSTCD11 year_lastweek_weekday(const iso_week::year &y, const iso_week::weekday &wd) NOEXCEPT
Definition: iso_week.h:1284
year_lastweek_weekday & operator+=(const years &y) NOEXCEPT
Definition: iso_week.h:1292
CONSTCD14 iso_week::weeknum weeknum() const NOEXCEPT
Definition: iso_week.h:1311
CONSTCD14 iso_week::weeknum weeknum() const NOEXCEPT
Definition: iso_week.h:1021
iso_week::year y_
Definition: iso_week.h:249
year_lastweek & operator+=(const years &dy) NOEXCEPT
Definition: iso_week.h:1033
CONSTCD11 iso_week::year year() const NOEXCEPT
Definition: iso_week.h:1016
CONSTCD11 year_lastweek(const iso_week::year &y) NOEXCEPT
Definition: iso_week.h:1012
year_lastweek & operator-=(const years &dy) NOEXCEPT
Definition: iso_week.h:1041
CONSTCD11 bool ok() const NOEXCEPT
Definition: iso_week.h:1029
iso_week::weeknum wn_
Definition: iso_week.h:374
year_weeknum_weekday & operator-=(const years &y) NOEXCEPT
Definition: iso_week.h:1466
CONSTCD11 year_weeknum_weekday(const iso_week::year &y, const iso_week::weeknum &wn, const iso_week::weekday &wd) NOEXCEPT
Definition: iso_week.h:1428
CONSTCD14 bool ok() const NOEXCEPT
Definition: iso_week.h:1495
static CONSTCD14 year_weeknum_weekday from_days(days dp) NOEXCEPT
Definition: iso_week.h:1503
CONSTCD11 iso_week::weekday weekday() const NOEXCEPT
Definition: iso_week.h:1474
iso_week::weekday wd_
Definition: iso_week.h:375
year_weeknum_weekday & operator+=(const years &y) NOEXCEPT
Definition: iso_week.h:1458
CONSTCD11 iso_week::year year() const NOEXCEPT
Definition: iso_week.h:1472
CONSTCD11 iso_week::weeknum weeknum() const NOEXCEPT
Definition: iso_week.h:1473
CONSTCD11 bool ok() const NOEXCEPT
Definition: iso_week.h:904
iso_week::year y_
Definition: iso_week.h:215
year_weeknum & operator+=(const years &dy) NOEXCEPT
Definition: iso_week.h:911
CONSTCD11 iso_week::weeknum weeknum() const NOEXCEPT
Definition: iso_week.h:903
CONSTCD11 year_weeknum(const iso_week::year &y, const iso_week::weeknum &wn) NOEXCEPT
Definition: iso_week.h:897
iso_week::weeknum wn_
Definition: iso_week.h:216
CONSTCD11 iso_week::year year() const NOEXCEPT
Definition: iso_week.h:902
year_weeknum & operator-=(const years &dy) NOEXCEPT
Definition: iso_week.h:919
CONSTCD11 bool ok() const NOEXCEPT
Definition: iso_week.h:603
CONSTCD11 year(int y) NOEXCEPT
Definition: iso_week.h:594
year & operator++() NOEXCEPT
Definition: iso_week.h:595
year & operator-=(const years &y) NOEXCEPT
Definition: iso_week.h:600
year & operator--() NOEXCEPT
Definition: iso_week.h:597
static CONSTCD11 year max() NOEXCEPT
Definition: iso_week.h:624
year & operator+=(const years &y) NOEXCEPT
Definition: iso_week.h:599
static CONSTCD11 year min() NOEXCEPT
Definition: iso_week.h:608
#define NOEXCEPT
Definition: date.h:135
#define CONSTDATA
Definition: date.h:132
#define CONSTCD14
Definition: date.h:134
#define CONSTCD11
Definition: date.h:133
CONSTDATA date::weekday mon
Definition: date.h:2005
CONSTDATA date::last_spec last
Definition: date.h:1989
CONSTDATA date::month dec
Definition: date.h:2002
CONSTDATA date::weekday thu
Definition: date.h:2008
Definition: date.h:88
std::chrono::duration< int, detail::ratio_multiply< std::ratio< 146097, 400 >, days::period > > years
Definition: date.h:183
local_time< days > local_days
Definition: date.h:202
std::chrono::duration< int, detail::ratio_multiply< std::ratio< 7 >, days::period > > weeks
Definition: date.h:180
std::chrono::duration< int, detail::ratio_multiply< std::ratio< 24 >, std::chrono::hours::period > > days
Definition: date.h:177
sys_time< days > sys_days
Definition: date.h:193
CONSTDATA iso_week::weekday wed
Definition: iso_week.h:757
CONSTDATA iso_week::last_week last
Definition: iso_week.h:752
CONSTDATA iso_week::weekday tue
Definition: iso_week.h:756
CONSTDATA iso_week::weekday fri
Definition: iso_week.h:759
CONSTDATA iso_week::weekday sun
Definition: iso_week.h:754
CONSTDATA iso_week::weekday sat
Definition: iso_week.h:760
CONSTDATA iso_week::weekday thu
Definition: iso_week.h:758
CONSTDATA iso_week::weekday mon
Definition: iso_week.h:755
date::days days
Definition: iso_week.h:37
date::sys_days sys_days
Definition: iso_week.h:43
CONSTCD11 bool operator<(const year &x, const year &y) NOEXCEPT
Definition: iso_week.h:656
CONSTCD11 bool operator>=(const year &x, const year &y) NOEXCEPT
Definition: iso_week.h:680
CONSTCD11 year_weeknum operator/(const year &y, const weeknum &wn) NOEXCEPT
Definition: iso_week.h:1608
CONSTCD14 weekday operator-(const weekday &x, const days &y) NOEXCEPT
Definition: iso_week.h:552
CONSTCD11 bool operator>(const year &x, const year &y) NOEXCEPT
Definition: iso_week.h:664
CONSTCD11 bool operator!=(const weekday &x, const weekday &y) NOEXCEPT
Definition: iso_week.h:517
date::years years
Definition: iso_week.h:39
CONSTCD11 bool operator==(const weekday &x, const weekday &y) NOEXCEPT
Definition: iso_week.h:509
std::basic_ostream< CharT, Traits > & operator<<(std::basic_ostream< CharT, Traits > &os, const weekday &wd)
Definition: iso_week.h:560
CONSTCD11 bool operator<=(const year &x, const year &y) NOEXCEPT
Definition: iso_week.h:672
CONSTCD14 weekday operator+(const weekday &x, const days &y) NOEXCEPT
Definition: iso_week.h:534
date::local_days local_days
Definition: iso_week.h:44
date::weeks weeks
Definition: iso_week.h:38
#define min(a, b)
Definition: resampler.cpp:34
#define max(a, b)
Definition: resampler.cpp:30