From Jason Turner

[time.zone.leap.overview]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpd7vkr5_w/{from.md → to.md} +63 -0
tmp/tmpd7vkr5_w/{from.md → to.md} RENAMED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Overview <a id="time.zone.leap.overview">[[time.zone.leap.overview]]</a>
2
+
3
+ ``` cpp
4
+ namespace std::chrono {
5
+ class leap_second {
6
+ public:
7
+ leap_second(const leap_second&) = default;
8
+ leap_second& operator=(const leap_second&) = default;
9
+
10
+ // unspecified additional constructors
11
+
12
+ constexpr sys_seconds date() const noexcept;
13
+ constexpr seconds value() const noexcept;
14
+ };
15
+ }
16
+ ```
17
+
18
+ Objects of type `leap_second` representing the date and value of the
19
+ leap second insertions are constructed and stored in the time zone
20
+ database when initialized.
21
+
22
+ [*Example 1*:
23
+
24
+ ``` cpp
25
+ for (auto& l : get_tzdb().leap_seconds)
26
+ if (l <= 2018y/March/17d)
27
+ cout << l.date() << ": " << l.value() << '\n';
28
+ ```
29
+
30
+ Produces the output:
31
+
32
+ ``` cpp
33
+ 1972-07-01 00:00:00: 1s
34
+ 1973-01-01 00:00:00: 1s
35
+ 1974-01-01 00:00:00: 1s
36
+ 1975-01-01 00:00:00: 1s
37
+ 1976-01-01 00:00:00: 1s
38
+ 1977-01-01 00:00:00: 1s
39
+ 1978-01-01 00:00:00: 1s
40
+ 1979-01-01 00:00:00: 1s
41
+ 1980-01-01 00:00:00: 1s
42
+ 1981-07-01 00:00:00: 1s
43
+ 1982-07-01 00:00:00: 1s
44
+ 1983-07-01 00:00:00: 1s
45
+ 1985-07-01 00:00:00: 1s
46
+ 1988-01-01 00:00:00: 1s
47
+ 1990-01-01 00:00:00: 1s
48
+ 1991-01-01 00:00:00: 1s
49
+ 1992-07-01 00:00:00: 1s
50
+ 1993-07-01 00:00:00: 1s
51
+ 1994-07-01 00:00:00: 1s
52
+ 1996-01-01 00:00:00: 1s
53
+ 1997-07-01 00:00:00: 1s
54
+ 1999-01-01 00:00:00: 1s
55
+ 2006-01-01 00:00:00: 1s
56
+ 2009-01-01 00:00:00: 1s
57
+ 2012-07-01 00:00:00: 1s
58
+ 2015-07-01 00:00:00: 1s
59
+ 2017-01-01 00:00:00: 1s
60
+ ```
61
+
62
+ — *end example*]
63
+