From Jason Turner

[time.cal.ymd.overview]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp7vsars8x/{from.md → to.md} +48 -0
tmp/tmp7vsars8x/{from.md → to.md} RENAMED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Overview <a id="time.cal.ymd.overview">[[time.cal.ymd.overview]]</a>
2
+
3
+ ``` cpp
4
+ namespace std::chrono {
5
+ class year_month_day {
6
+ chrono::year y_; // exposition only
7
+ chrono::month m_; // exposition only
8
+ chrono::day d_; // exposition only
9
+
10
+ public:
11
+ year_month_day() = default;
12
+ constexpr year_month_day(const chrono::year& y, const chrono::month& m,
13
+ const chrono::day& d) noexcept;
14
+ constexpr year_month_day(const year_month_day_last& ymdl) noexcept;
15
+ constexpr year_month_day(const sys_days& dp) noexcept;
16
+ constexpr explicit year_month_day(const local_days& dp) noexcept;
17
+
18
+ constexpr year_month_day& operator+=(const months& m) noexcept;
19
+ constexpr year_month_day& operator-=(const months& m) noexcept;
20
+ constexpr year_month_day& operator+=(const years& y) noexcept;
21
+ constexpr year_month_day& operator-=(const years& y) noexcept;
22
+
23
+ constexpr chrono::year year() const noexcept;
24
+ constexpr chrono::month month() const noexcept;
25
+ constexpr chrono::day day() const noexcept;
26
+
27
+ constexpr operator sys_days() const noexcept;
28
+ constexpr explicit operator local_days() const noexcept;
29
+ constexpr bool ok() const noexcept;
30
+ };
31
+ }
32
+ ```
33
+
34
+ `year_month_day` represents a specific year, month, and day.
35
+ `year_month_day` is a field-based time point with a resolution of
36
+ `days`.
37
+
38
+ [*Note 1*: `year_month_day` supports `years`- and `months`-oriented
39
+ arithmetic, but not `days`-oriented arithmetic. For the latter, there is
40
+ a conversion to `sys_days`, which efficiently supports `days`-oriented
41
+ arithmetic. — *end note*]
42
+
43
+ `year_month_day` meets the *Cpp17EqualityComparable* (
44
+ [[cpp17.equalitycomparable]]) and *Cpp17LessThanComparable* (
45
+ [[cpp17.lessthancomparable]]) requirements.
46
+
47
+ `year_month_day` is a trivially copyable and standard-layout class type.
48
+