tmp/tmpb1_1dxcg/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### Class `weekday_last` <a id="time.cal.wdlast">[[time.cal.wdlast]]</a>
|
| 2 |
+
|
| 3 |
+
#### Overview <a id="time.cal.wdlast.overview">[[time.cal.wdlast.overview]]</a>
|
| 4 |
+
|
| 5 |
+
``` cpp
|
| 6 |
+
namespace std::chrono {
|
| 7 |
+
class weekday_last {
|
| 8 |
+
chrono::weekday wd_; // exposition only
|
| 9 |
+
|
| 10 |
+
public:
|
| 11 |
+
constexpr explicit weekday_last(const chrono::weekday& wd) noexcept;
|
| 12 |
+
|
| 13 |
+
constexpr chrono::weekday weekday() const noexcept;
|
| 14 |
+
constexpr bool ok() const noexcept;
|
| 15 |
+
};
|
| 16 |
+
}
|
| 17 |
+
```
|
| 18 |
+
|
| 19 |
+
`weekday_last` represents the last weekday of a month.
|
| 20 |
+
|
| 21 |
+
[*Note 1*: A `weekday_last` object can be constructed by indexing a
|
| 22 |
+
`weekday` with `last`. — *end note*]
|
| 23 |
+
|
| 24 |
+
[*Example 1*:
|
| 25 |
+
|
| 26 |
+
``` cpp
|
| 27 |
+
constexpr auto wdl = Sunday[last]; // wdl is the last Sunday of an as yet unspecified month
|
| 28 |
+
static_assert(wdl.weekday() == Sunday);
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
— *end example*]
|
| 32 |
+
|
| 33 |
+
`weekday_last` is a trivially copyable and standard-layout class type.
|
| 34 |
+
|
| 35 |
+
#### Member functions <a id="time.cal.wdlast.members">[[time.cal.wdlast.members]]</a>
|
| 36 |
+
|
| 37 |
+
``` cpp
|
| 38 |
+
constexpr explicit weekday_last(const chrono::weekday& wd) noexcept;
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
*Effects:* Initializes `wd_` with `wd`.
|
| 42 |
+
|
| 43 |
+
``` cpp
|
| 44 |
+
constexpr chrono::weekday weekday() const noexcept;
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
*Returns:* `wd_`.
|
| 48 |
+
|
| 49 |
+
``` cpp
|
| 50 |
+
constexpr bool ok() const noexcept;
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
*Returns:* `wd_.ok()`.
|
| 54 |
+
|
| 55 |
+
#### Non-member functions <a id="time.cal.wdlast.nonmembers">[[time.cal.wdlast.nonmembers]]</a>
|
| 56 |
+
|
| 57 |
+
``` cpp
|
| 58 |
+
constexpr bool operator==(const weekday_last& x, const weekday_last& y) noexcept;
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
*Returns:* `x.weekday() == y.weekday()`.
|
| 62 |
+
|
| 63 |
+
``` cpp
|
| 64 |
+
template<class charT, class traits>
|
| 65 |
+
basic_ostream<charT, traits>&
|
| 66 |
+
operator<<(basic_ostream<charT, traits>& os, const weekday_last& wdl);
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
*Effects:* Equivalent to:
|
| 70 |
+
|
| 71 |
+
``` cpp
|
| 72 |
+
return os << format(os.getloc(), STATICALLY-WIDEN<charT>("{}[last]"), wdl.weekday());
|
| 73 |
+
```
|
| 74 |
+
|