tmp/tmpynq2nfty/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,116 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### Non-member functions <a id="time.cal.ym.nonmembers">[[time.cal.ym.nonmembers]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
constexpr bool operator==(const year_month& x, const year_month& y) noexcept;
|
| 5 |
+
```
|
| 6 |
+
|
| 7 |
+
*Returns:* `x.year() == y.year() && x.month() == y.month()`.
|
| 8 |
+
|
| 9 |
+
``` cpp
|
| 10 |
+
constexpr strong_ordering operator<=>(const year_month& x, const year_month& y) noexcept;
|
| 11 |
+
```
|
| 12 |
+
|
| 13 |
+
*Effects:* Equivalent to:
|
| 14 |
+
|
| 15 |
+
``` cpp
|
| 16 |
+
if (auto c = x.year() <=> y.year(); c != 0) return c;
|
| 17 |
+
return x.month() <=> y.month();
|
| 18 |
+
```
|
| 19 |
+
|
| 20 |
+
``` cpp
|
| 21 |
+
constexpr year_month operator+(const year_month& ym, const months& dm) noexcept;
|
| 22 |
+
```
|
| 23 |
+
|
| 24 |
+
*Constraints:* If the argument supplied by the caller for the `months`
|
| 25 |
+
parameter is convertible to `years`, its implicit conversion sequence to
|
| 26 |
+
`years` is worse than its implicit conversion sequence to `months`
|
| 27 |
+
[[over.ics.rank]].
|
| 28 |
+
|
| 29 |
+
*Returns:* A `year_month` value `z` such that `z.ok() && z - ym == dm`
|
| 30 |
+
is `true`.
|
| 31 |
+
|
| 32 |
+
*Complexity:* 𝑂(1) with respect to the value of `dm`.
|
| 33 |
+
|
| 34 |
+
``` cpp
|
| 35 |
+
constexpr year_month operator+(const months& dm, const year_month& ym) noexcept;
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
*Constraints:* If the argument supplied by the caller for the `months`
|
| 39 |
+
parameter is convertible to `years`, its implicit conversion sequence to
|
| 40 |
+
`years` is worse than its implicit conversion sequence to `months`
|
| 41 |
+
[[over.ics.rank]].
|
| 42 |
+
|
| 43 |
+
*Returns:* `ym + dm`.
|
| 44 |
+
|
| 45 |
+
``` cpp
|
| 46 |
+
constexpr year_month operator-(const year_month& ym, const months& dm) noexcept;
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
*Constraints:* If the argument supplied by the caller for the `months`
|
| 50 |
+
parameter is convertible to `years`, its implicit conversion sequence to
|
| 51 |
+
`years` is worse than its implicit conversion sequence to `months`
|
| 52 |
+
[[over.ics.rank]].
|
| 53 |
+
|
| 54 |
+
*Returns:* `ym + -dm`.
|
| 55 |
+
|
| 56 |
+
``` cpp
|
| 57 |
+
constexpr months operator-(const year_month& x, const year_month& y) noexcept;
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
*Returns:*
|
| 61 |
+
|
| 62 |
+
``` cpp
|
| 63 |
+
x.year() - y.year() + months{static_cast<int>(unsigned{x.month()}) -
|
| 64 |
+
static_cast<int>(unsigned{y.month()})}
|
| 65 |
+
```
|
| 66 |
+
|
| 67 |
+
``` cpp
|
| 68 |
+
constexpr year_month operator+(const year_month& ym, const years& dy) noexcept;
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
*Returns:* `(ym.year() + dy) / ym.month()`.
|
| 72 |
+
|
| 73 |
+
``` cpp
|
| 74 |
+
constexpr year_month operator+(const years& dy, const year_month& ym) noexcept;
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
*Returns:* `ym + dy`.
|
| 78 |
+
|
| 79 |
+
``` cpp
|
| 80 |
+
constexpr year_month operator-(const year_month& ym, const years& dy) noexcept;
|
| 81 |
+
```
|
| 82 |
+
|
| 83 |
+
*Returns:* `ym + -dy`.
|
| 84 |
+
|
| 85 |
+
``` cpp
|
| 86 |
+
template<class charT, class traits>
|
| 87 |
+
basic_ostream<charT, traits>&
|
| 88 |
+
operator<<(basic_ostream<charT, traits>& os, const year_month& ym);
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
*Effects:* Equivalent to:
|
| 92 |
+
|
| 93 |
+
``` cpp
|
| 94 |
+
return os << format(os.getloc(), STATICALLY-WIDEN<charT>("{}/{}"),
|
| 95 |
+
ym.year(), ym.month());
|
| 96 |
+
```
|
| 97 |
+
|
| 98 |
+
``` cpp
|
| 99 |
+
template<class charT, class traits, class Alloc = allocator<charT>>
|
| 100 |
+
basic_istream<charT, traits>&
|
| 101 |
+
from_stream(basic_istream<charT, traits>& is, const charT* fmt,
|
| 102 |
+
year_month& ym, basic_string<charT, traits, Alloc>* abbrev = nullptr,
|
| 103 |
+
minutes* offset = nullptr);
|
| 104 |
+
```
|
| 105 |
+
|
| 106 |
+
*Effects:* Attempts to parse the input stream `is` into the `year_month`
|
| 107 |
+
`ym` using the format flags given in the NTCTS `fmt` as specified in
|
| 108 |
+
[[time.parse]]. If the parse fails to decode a valid `year_month`,
|
| 109 |
+
`is.setstate(ios_base::failbit)` is called and `ym` is not modified. If
|
| 110 |
+
`%Z` is used and successfully parsed, that value will be assigned to
|
| 111 |
+
`*abbrev` if `abbrev` is non-null. If `%z` (or a modified variant) is
|
| 112 |
+
used and successfully parsed, that value will be assigned to `*offset`
|
| 113 |
+
if `offset` is non-null.
|
| 114 |
+
|
| 115 |
+
*Returns:* `is`.
|
| 116 |
+
|