From Jason Turner

[time.cal.year.nonmembers]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpj0gcog95/{from.md → to.md} +77 -0
tmp/tmpj0gcog95/{from.md → to.md} RENAMED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Non-member functions <a id="time.cal.year.nonmembers">[[time.cal.year.nonmembers]]</a>
2
+
3
+ ``` cpp
4
+ constexpr bool operator==(const year& x, const year& y) noexcept;
5
+ ```
6
+
7
+ *Returns:* `int{x} == int{y}`.
8
+
9
+ ``` cpp
10
+ constexpr strong_ordering operator<=>(const year& x, const year& y) noexcept;
11
+ ```
12
+
13
+ *Returns:* `int{x} <=> int{y}`.
14
+
15
+ ``` cpp
16
+ constexpr year operator+(const year& x, const years& y) noexcept;
17
+ ```
18
+
19
+ *Returns:* `year{int{x} + y.count()}`.
20
+
21
+ ``` cpp
22
+ constexpr year operator+(const years& x, const year& y) noexcept;
23
+ ```
24
+
25
+ *Returns:* `y + x`.
26
+
27
+ ``` cpp
28
+ constexpr year operator-(const year& x, const years& y) noexcept;
29
+ ```
30
+
31
+ *Returns:* `x + -y`.
32
+
33
+ ``` cpp
34
+ constexpr years operator-(const year& x, const year& y) noexcept;
35
+ ```
36
+
37
+ *Returns:* `years{int{x} - int{y}}`.
38
+
39
+ ``` cpp
40
+ template<class charT, class traits>
41
+ basic_ostream<charT, traits>&
42
+ operator<<(basic_ostream<charT, traits>& os, const year& y);
43
+ ```
44
+
45
+ *Effects:* Equivalent to:
46
+
47
+ ``` cpp
48
+ return os << (y.ok() ?
49
+ format(STATICALLY-WIDEN<charT>("{:%Y}"), y) :
50
+ format(STATICALLY-WIDEN<charT>("{:%Y} is not a valid year"), y));
51
+ ```
52
+
53
+ ``` cpp
54
+ template<class charT, class traits, class Alloc = allocator<charT>>
55
+ basic_istream<charT, traits>&
56
+ from_stream(basic_istream<charT, traits>& is, const charT* fmt,
57
+ year& y, basic_string<charT, traits, Alloc>* abbrev = nullptr,
58
+ minutes* offset = nullptr);
59
+ ```
60
+
61
+ *Effects:* Attempts to parse the input stream `is` into the `year` `y`
62
+ using the format flags given in the NTCTS `fmt` as specified in
63
+ [[time.parse]]. If the parse fails to decode a valid year,
64
+ `is.setstate(ios_base::failbit)` is called and `y` is not modified. If
65
+ `%Z` is used and successfully parsed, that value will be assigned to
66
+ `*abbrev` if `abbrev` is non-null. If `%z` (or a modified variant) is
67
+ used and successfully parsed, that value will be assigned to `*offset`
68
+ if `offset` is non-null.
69
+
70
+ *Returns:* `is`.
71
+
72
+ ``` cpp
73
+ constexpr chrono::year operator""y(unsigned long long y) noexcept;
74
+ ```
75
+
76
+ *Returns:* `year{static_cast<int>(y)}`.
77
+