From Jason Turner

[time.cal.year.overview]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmphgv5x3hn/{from.md → to.md} +43 -0
tmp/tmphgv5x3hn/{from.md → to.md} RENAMED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Overview <a id="time.cal.year.overview">[[time.cal.year.overview]]</a>
2
+
3
+ ``` cpp
4
+ namespace std::chrono {
5
+ class year {
6
+ short y_; // exposition only
7
+ public:
8
+ year() = default;
9
+ constexpr explicit year(int y) noexcept;
10
+
11
+ constexpr year& operator++() noexcept;
12
+ constexpr year operator++(int) noexcept;
13
+ constexpr year& operator--() noexcept;
14
+ constexpr year operator--(int) noexcept;
15
+
16
+ constexpr year& operator+=(const years& y) noexcept;
17
+ constexpr year& operator-=(const years& y) noexcept;
18
+
19
+ constexpr year operator+() const noexcept;
20
+ constexpr year operator-() const noexcept;
21
+
22
+ constexpr bool is_leap() const noexcept;
23
+
24
+ constexpr explicit operator int() const noexcept;
25
+ constexpr bool ok() const noexcept;
26
+
27
+ static constexpr year min() noexcept;
28
+ static constexpr year max() noexcept;
29
+ };
30
+ }
31
+ ```
32
+
33
+ `year` represents a year in the civil calendar. It can represent values
34
+ in the range \[`min()`, `max()`\]. It can be constructed with any `int`
35
+ value, which will be subsequently truncated to fit into `year`’s
36
+ unspecified internal storage. `year` meets the *Cpp17EqualityComparable*
37
+ ([[cpp17.equalitycomparable]]) and *Cpp17LessThanComparable* (
38
+ [[cpp17.lessthancomparable]]) requirements, and participates in basic
39
+ arithmetic with `years` objects, which represent a difference between
40
+ two `year` objects.
41
+
42
+ `year` is a trivially copyable and standard-layout class type.
43
+