Skip to content

Commit 1cc3313

Browse files
author
Colin Robertson
authored
Merge pull request MicrosoftDocs#3235 from MicrosoftDocs/master637607577885278916
Repo sync for protected CLA branch
2 parents 055ef55 + 9ad14d5 commit 1cc3313

10 files changed

+56
-56
lines changed

docs/build/reference/zp-struct-member-alignment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ The available packing values are described in the following table:
3131
Don't use this option unless you have specific alignment requirements.
3232

3333
> [!WARNING]
34-
> The C/C++ headers in the Windows SDK assume **`/Zp8`** packing internally. Don't change the setting from the default when you include the Windows SDK headers, either by using **`/Zp`** on the command line or by using `#pragma pack`. Otherwise, your application may cause memory corruption at runtime.
34+
> The C/C++ headers in the Windows SDK assume the platform's default alignment is used. Don't change the setting from the default when you include the Windows SDK headers, either by using **`/Zp`** on the command line or by using `#pragma pack`. Otherwise, your application may cause memory corruption at runtime.
3535
3636
You can also use the [`pack` pragma](../../preprocessor/pack.md) to control structure packing. For more information about alignment, see:
3737

docs/standard-library/chrono-operators.md

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about: <chrono> operators"
33
title: "<chrono> operators"
4-
ms.date: "6/24/2021"
4+
ms.date: "6/30/2021"
55
f1_keywords: ["chrono/std::operator modulo", "chrono/std::operator+", "chrono/std::chrono::day::operator+", "chrono/std::chrono::duration::operator+", "chrono/std::chrono::month::operator+", "chrono/std::chrono::time_point::operator+", "chrono/std::chrono::weekday::operator+", "chrono/std::chrono::year_month::operator+", "chrono/std::chrono::year::operator+", "chrono/std::chrono::year_month_day::operator+", "chrono/std::chrono::year_month_day_last::operator+", "chrono/std::chrono::year_month_weekday::operator+", "chrono/std::chrono::year_month_weekday_last::operator+", "chrono/std::operator!=", "chrono/std::operator*", "chrono/std::operator/", "chrono/std::operator-", "chrono/std::operator<", "chrono/std::operator<=", "chrono/std::operator<", "chrono/std::operator==", "chrono/std::operator>>", "chrono/std::operator<=>", "chrono/std::chrono::day::operator<=>", "chrono/std::chrono::month::operator<=>", "chrono/std::chrono::year::operator<=>", "chrono/std::chrono::year_month::operator<=>", "chrono/std::chrono::time_point::operator<=>", "chrono/std::chrono::duration::operator<=>", "chrono/std::chrono::month_day_last::operator<=>", "chrono/std::chrono::year_month_day_last::operator<=>", "chrono/std::operator==", "chrono/std::chrono::year::operator<==>", "chrono/std::chrono::day::operator==", "chrono/std::chrono::duration::operator==", "chrono/std::chrono::month::operator==", "chrono/std::chrono::month_day::operator==", "chrono/std::chrono::month_day_last::operator==", "chrono/std::chrono::month_weekday::operator==", "chrono/std::chrono::month_weekday_last::operator==", "chrono/std::chrono::time_point::operator==", "chrono/std::chrono::weekday::operator==", "chrono/std::chrono::year_month::operator==", "chrono/std::chrono::year::operator==", "chrono/std::chrono::year_month_day::operator==", "chrono/std::chrono::year_month_day_last::operator==", "chrono/std::chrono::year_month_weekday_last::operator==", "chrono/std::chrono::year_month_weekday::operator==", "chrono/std::chrono::month_weekday_last::operator==", "chrono/std::chrono::weekday::operator==", "chrono/std::chrono::weekday_last::operator==", "chrono/std::chrono::year_month_weekday_indexed::operator==", "chrono/std::chrono::year_month_weekday_last::operator==", "chrono/std::chrono::year::operator==", "chrono/std::chrono::year_month::operator==", "chrono/std::chrono::year_month_day::operator==", "chrono/std::chrono::year_month_day_last::operator==", "chrono/std::operator-", "chrono/std::chrono::day::operator-", "chrono/std::chrono::duration::operator-", "chrono/std::chrono::month::operator-", "chrono/std::chrono::time_point::operator-", "chrono/std::chrono::weekday::operator-", "chrono/std::chrono::year_month::operator-", "chrono/std::chrono::year::operator-", "chrono/std::chrono::year_month_day::operator-", "chrono/std::chrono::year_month_day_last::operator-", "chrono/std::chrono::year_month_weekday::operator-", "chrono/std::chrono::year_month_weekday_last::operator-", "chrono/std::chrono::day::operator<<", "chrono/std::chrono::hh_mm_ss::operator<<", "chrono/std::chrono::month_day::operator<<", "chrono/std::chrono::month_day_last::operator<<", "chrono/std::chrono::month_weekday::operator<<", "chrono/std::chrono::month_weekday_last::operator<<", "chrono/std::chrono::weekday::operator<<", "chrono/std::chrono::weekday_indexed::operator<<", "chrono/std::chrono::weekday_last::operator<<", "chrono/std::chrono::year::operator<<", "chrono/std::chrono::year_month_day::operator<<", "chrono/std::chrono::year_month_day_last::operator<<", "chrono/std::chrono::year_month_weekday::operator<<"]
66
---
77
# `<chrono>` operators
@@ -80,6 +80,7 @@ constexpr year_month_day_last operator+(const months& dm, const year_month_day_l
8080

8181
12)
8282
constexpr year_month_day_last operator+(const year_month_day_last& ymdl, const years& dy) noexcept; // C++ 20
83+
constexpr year_month_day_last operator+(const years& dy, const year_month_day_last& ymdl) noexcept; // C++ 20
8384

8485
13)
8586
constexpr year_month_weekday operator+(const year_month_weekday& ymwd, const months& dm) noexcept; // C++ 20
@@ -173,8 +174,6 @@ int main()
173174
}
174175
```
175176

176-
Output:
177-
178177
```output
179178
03
180179
Feb
@@ -363,7 +362,7 @@ int main()
363362
364363
// year_month_day_last
365364
year_month_day_last ymdl = June / last / 2021;
366-
std::cout << ymdl + years{1} + months{1} << '\n'; // 2022/Jul/last
365+
std::cout << ymdl - years{1} - months{1} << '\n'; // 2022/Jul/last
367366
368367
// year_month_weekday
369368
year_month_weekday ymw{ year(1997) / January / Wednesday[1] };
@@ -387,7 +386,7 @@ Dec
387386
2020
388387
2021/Apr
389388
2019/Jun
390-
2022/Jul/last
389+
2020/May/last
391390
1996/Dec/Wed[1]
392391
1996/Jan/Wed[1]
393392
1996/Dec/Wed[last]
@@ -396,9 +395,7 @@ Dec
396395

397396
## <a name="op_unary_negate"></a> Unary `operator-`
398397

399-
Negates the following types:
400-
401-
- [`duration`](duration-class.md)
398+
Negates a [`duration`](duration-class.md).
402399

403400
```cpp
404401
constexpr common_type_t<duration> operator-() const;
@@ -425,15 +422,13 @@ int main()
425422
}
426423
```
427424

428-
Output:
429-
430425
```output
431426
-120ms
432427
```
433428

434429
## <a name="op_neq"></a> `operator!=`
435430

436-
Inequality operator for [`duration`](../standard-library/duration-class.md) or [`time_point`](../standard-library/time-point-class.md) objects.
431+
Inequality operator for [`duration`](duration-class.md) or [`time_point`](time-point-class.md) objects.
437432

438433
```cpp
439434
template <class Rep1, class Period1, class Rep2, class Period2>
@@ -555,6 +550,7 @@ Each function returns `!(Right < Left)`.
555550
## <a name="op_eq_eq"></a> `operator==`
556551

557552
Determines whether:
553+
558554
1\) [`duration`](duration-class.md) objects represent time intervals that have the same length.\
559555
2\) [`time_point`](time-point-class.md) objects represent the same point in time.\
560556
3\) [`day`](day-class.md) objects represent the same day.\
@@ -568,9 +564,10 @@ Determines whether:
568564
11\) [`weekday_indexed`](weekdayindexed-class.md) represent the same weekday index.\
569565
12\) [`year`](year-class.md) represent the same year.\
570566
13\) [`year_month`](year-month-class.md) represent the same year and month.\
571-
14\) [`year_month_day`](year-month-day-class.md) represent the same year, month, and day.
572-
15\) [`year_month_day_last`](year-month-day-last-class.md) represent the same last day of the year and month.
573-
16\) [`year_month_weekday`](year-month-weekday-class.md) represent the same weekday, year, and month.
567+
14\) [`year_month_day`](year-month-day-class.md) represent the same year, month, and day.\
568+
15\) [`year_month_day_last`](year-month-day-last-class.md) represent the same last day of the year and month.\
569+
16\) [`year_month_weekday`](year-month-weekday-class.md) represent the same weekday, year, and month.\
570+
17\) [`year_month_weekday_last`](year-month-weekday-last-class.md) represent the same last weekday of the month, year, and month.
574571

575572
```cpp
576573
// 1) duration<Rep, Period>
@@ -626,6 +623,9 @@ constexpr bool operator==(const year_month_day_last& Left, const year_month_day_
626623

627624
// 16) year_month_weekday
628625
constexpr bool operator==(const year_month_weekday& Left, const year_month_weekday& Right) noexcept; // C++ 20
626+
627+
// 17) year_month_weekday_last
628+
constexpr bool operator==(const year_month_weekday_last& Left, const year_month_weekday_last& Right) noexcept; // C++ 20
629629
```
630630
631631
### Parameters
@@ -640,7 +640,7 @@ The right object to compare.
640640
641641
1\) Returns **`true`** if *`Left`* and *`Right`* represent time intervals that have the same length. Otherwise, the function returns **`false`**.\
642642
2\) Returns **`true`** if *`Left`* and *`Right`* represent the same point in time. Otherwise, returns **`false`**.\
643-
3-15\) Returns **`true`** if *`Left`* and *`Right`* have the same value. Otherwise, returns **`false`**.
643+
3-17\) Returns **`true`** if *`Left`* and *`Right`* have the same value. Otherwise, returns **`false`**.
644644
645645
## <a name="op_gt"></a> `operator>`
646646
@@ -715,12 +715,18 @@ The spaceship operator, in conjunction with `operator==`, synthesizes operators
715715
```cpp
716716
// 1)
717717
constexpr bool operator<=>(const day& Left, const day& Right) noexcept; // C++ 20
718+
718719
constexpr std::strong_ordering operator<=>(const month& Left, const month& Right) noexcept; // C++ 20
720+
719721
constexpr strong_ordering operator<=>(const month_day& Left, const month_day& Right) noexcept; // C++ 20
722+
720723
constexpr std::strong_ordering operator<=>(const year& Left, const year& Right ) noexcept; // C++ 20
724+
721725
constexpr strong_ordering operator<=>(const year_month& Left, const year_month& Right) noexcept; // C++ 20
726+
722727
template<class Clock, class Duration1, three_­way_­comparable_­with<Duration1> Duration2>
723728
constexpr auto operator<=>(const time_point<Clock, Duration1>& Left, const time_point<Clock, Duration2>& Right); // C++ 20
729+
724730
template<class Rep1, class Period1, class Rep2, class Period2>
725731
requires three_­way_­comparable<typename CT::rep>
726732
constexpr auto operator<=>(const duration<Rep1, Period1>& Left, const duration<Rep2, Period2>& Right);
@@ -739,15 +745,15 @@ The [`day`](day-class.md), [`duration`](duration-class.md), [`month`](month-clas
739745

740746
### Return value
741747

742-
1\)
748+
1\)\
743749
`0` if `Left == Right`\
744750
`< 0` if `Left < Right`\
745751
`> 0` if `Left > Right`
746752

747-
2\)
753+
2\)\
748754
Equivalent to: `Left.month() <=> Right.month()`
749755

750-
3\)
756+
3\)\
751757
Equivalent to:
752758

753759
```cpp
@@ -788,8 +794,6 @@ int main()
788794
}
789795
```
790796

791-
Output:
792-
793797
```output
794798
d1 < d2
795799
true true false
@@ -1374,8 +1378,8 @@ int main()
13741378
month_day_last mdl{ January / last }; // Jan/last
13751379
month_weekday mw{ 11 / Monday[1] }; // Nov/Mon[1]
13761380
month_weekday_last mwl{ January / Monday[last] }; // Jan/Mon[last]
1377-
weekday wd{ Monday }; // Monday
1378-
weekday_indexed wdi{ Monday, 1}; // Monday[1]
1381+
weekday wd{ Monday }; // Mon
1382+
weekday_indexed wdi{ Monday, 1 }; // Mon[1]
13791383
year_month ym{ 2021y / April }; // 2021/Apr
13801384
year_month_day ymd{ January / 1d / 2021y }; // 2021-01-01
13811385
year_month_day ymd2{ 2021y / 5 / 7 }; // 2021-05-07
@@ -1385,12 +1389,13 @@ int main()
13851389
int yearValue{ 2021 / 4 / 4 }; // 126
13861390

13871391
std::cout << m << '\n' << md << '\n' << md2 << '\n' << mdl << '\n' << mw
1388-
<< '\n' << mwl << '\n' << wd << '\n' << wdi << '\n'
1389-
<< ym << '\n' << ymd2 << '\n' << ymdl
1390-
<< '\n' << ymw << '\n' << ymwl << '\n' << yearValue;
1392+
<< '\n' << mwl << '\n' << wd << '\n' << wdi << '\n'
1393+
<< ym << '\n' << ymd << '\n' << ymd2 << '\n' << ymdl
1394+
<< '\n' << ymw << '\n' << ymwl << '\n' << yearValue;
13911395

13921396
return 0;
13931397
}
1398+
```
13941399

13951400
```output
13961401
Jul
@@ -1402,6 +1407,7 @@ Jan/Mon[last]
14021407
Mon
14031408
Mon[1]
14041409
2021/Apr
1410+
2021-01-01
14051411
2021-05-07
14061412
1975/Apr/last
14071413
1997/Jan/Wed[1]

docs/standard-library/day-class.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ int main()
139139
}
140140
```
141141

142-
Output:
143-
144142
```output
145143
01 02
146144
02 02
@@ -183,8 +181,6 @@ int main()
183181
}
184182
```
185183

186-
Output:
187-
188184
```output
189185
05 04
190186
04 04
@@ -260,7 +256,6 @@ int main()
260256
}
261257
```
262258

263-
Output:
264259
```Output
265260
14
266261
```

docs/standard-library/weekday-class.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,6 @@ int main()
299299
}
300300
```
301301

302-
Output:
303-
304302
```output
305303
2021-01-11
306304
2021-01-26

docs/standard-library/weekdayindexed-class.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ int main()
120120
}
121121
```
122122

123-
Output:
124-
125123
```output
126124
Mon[1]
127125
```

docs/standard-library/year-class.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ int main()
175175
}
176176
```
177177

178-
Output:
179-
180178
```output
181179
-0001
182180
```
@@ -255,8 +253,6 @@ int main()
255253
}
256254
```
257255

258-
Output:
259-
260256
```output
261257
-1977
262258
```

docs/standard-library/year-month-day-class.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22
description: "Learn more about: year_month_day class"
33
title: "year_month_day class"
44
ms.date: "06/28/2021"
5-
f1_keywords: ["chrono/std::chrono::year_month_day", "chrono/std::chrono::year::operator+=", "chrono/std::chrono::year::operator-=", "chrono/std::chrono::year::ok"]
5+
f1_keywords: ["chrono/std::chrono::year_month_day", "chrono/std::chrono::year::operator+=", "chrono/std::chrono::year::operator-=", "chrono/std::chrono::year::sysdays", "chrono/std::chrono::year::localdays", "chrono/std::chrono::year::ok"]
66
helpviewer_keywords: ["std::chrono [C++], year_month_day"]
77
---
8+
89
# `year_month_day` class
910

1011
Represents a month, year, and day.
1112

1213
## Syntax
1314

1415
```cpp
15-
class year_month_day; // C++20
16+
class year_month_day; // C++ 20
1617
```
1718

1819
## Members
@@ -42,7 +43,7 @@ class year_month_day; // C++20
4243

4344
## Requirements
4445

45-
**Header:** `<chrono>` (since C++20)
46+
**Header:** `<chrono>` (since C++ 20)
4647

4748
**Namespace:** `std::chrono`
4849

docs/standard-library/year-month-day-last-class.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: "Learn more about: year_month_day_last class"
33
title: "year_month_day_last class"
44
ms.date: "06/28/2021"
5-
f1_keywords: ["chrono/std::chrono::year_month_day_last", "chrono/std::chrono::year_month_day_last::operator+=", "chrono/std::chrono::year_month_day_last::operator-=", "chrono/std::chrono::year_month_day_last::day", "chrono/std::chrono::year_month_day_last::year", "chrono/std::chrono::year_month_day_last::ok"]
5+
f1_keywords: ["chrono/std::chrono::year_month_day_last", "chrono/std::chrono::year_month_day_last::operator+=", "chrono/std::chrono::year_month_day_last::operator-=", "chrono/std::chrono::year_month_day_last::sysdays", "chrono/std::chrono::year_month_day_last::localdays", "chrono/std::chrono::year_month_day_last::day", "chrono/std::chrono::year_month_day_last::year", "chrono/std::chrono::year_month_day_last::ok"]
66
helpviewer_keywords: ["std::chrono [C++], year_month_day_last"]
77
---
88
# `year_month_day_last` class
@@ -157,11 +157,15 @@ The [`month`](month-class.md) value.
157157

158158
Gets the `month_day_last` value stored in this `year_month_day_last`.
159159

160+
```cpp
161+
constexpr month_day_last month_day_last() const noexcept;
162+
```
163+
160164
### Return value
161165

162166
The [`month_day_last`](month-day-last-class.md) value stored in this `year_month_day_last`.
163167

164-
## <a name="sys_days"></a> `month_day_last::operator sys_days`
168+
## <a name="sys_days"></a> `operator sys_days`
165169

166170
Get the month, day, and year in this `year_month_day_last` as a count of days from the epoch for the system clock.
167171

docs/standard-library/year-month-weekday-class.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
22
description: "Learn more about: year_month_weekday class"
33
title: "year_month_weekday class"
4-
ms.date: "06/28/2021"
5-
f1_keywords: ["chrono/std::chrono::year_month_weekday", "chrono/std::chrono::year_month_weekday::weekday", "chrono/std::chrono::year_month_weekday::month", "chrono/std::chrono::year_month_weekday::index", "chrono/std::chrono::year_month_weekday::year", "chrono/std::chrono::year_month_weekday::weekday_indexed", "chrono/std::chrono::year_month_weekday::operatorsys_days", "chrono/std::chrono::year_month_weekday::local_days", "chrono/std::chrono::year_month_weekday::ok", "chrono/std::chrono::year_month_weekday::operator+=", "chrono/std::chrono::year_month_weekday::operator-="]
4+
ms.date: "06/30/2021"
5+
f1_keywords: ["chrono/std::chrono::year_month_weekday", "chrono/std::chrono::year_month_weekday::weekday", "chrono/std::chrono::year_month_weekday::month", "chrono/std::chrono::year_month_weekday::index", "chrono/std::chrono::year_month_weekday::year", "chrono/std::chrono::year_month_weekday::weekday_indexed", "chrono/std::chrono::year_month_weekday::sys_days", "chrono/std::chrono::year_month_weekday::local_days", "chrono/std::chrono::year_month_weekday::ok", "chrono/std::chrono::year_month_weekday::operator+=", "chrono/std::chrono::year_month_weekday::operator-="]
66
helpviewer_keywords: ["std::chrono [C++], year_month_weekday"]
77
---
88

@@ -78,22 +78,24 @@ constexpr year_month_weekday(const sys_days& dp) noexcept;
7878
*`m`*\
7979
The [`month`](month-class.md) value.
8080
81-
*`dp`*
81+
*`dp`*\
8282
A [`sys_days`](chrono.md#alias-declarations) or [`local_days`](chrono.md#alias-declarations)
8383
8484
*`wdi`*\
8585
The [`weekday`](weekday-class.md) value.
8686
8787
*`y`*\
88-
The [`year`] value.
88+
The [`year`](year-class.md) value.
8989
9090
### Remarks: Constructor
9191
9292
1\) The default constructor doesn't initialize any of the fields.
9393
94+
2\) Constructs a `year_month_weekday` that corresponds to the specified `year`, `month`, and `weekday_indexed`.
95+
9496
3\) Constructs a `year_month_weekday` that corresponds to the date represented by `sys_days{dp.time_since_epoch()}`.
9597
96-
4\) Constructs a `year_month_weekday` that corresponds to the date represented by *`dp`*. For any `year_month_weekday` for which `ok()` is `true`, `year_month_weekday{sys_days{ymdl}}` is `true`.
98+
4\) Constructs a `year_month_weekday` that corresponds to the date represented by *`dp`*. For any `year_month_weekday` (ymdl) for which `ok()` is `true`, comparison with `operator==` to `year_month_weekday{sys_days{ymdl}}` will be `true`.
9799
98100
For information about C++ 20 syntax used to specify dates, see [`operator/`](chrono-operators.md#op_/)
99101
@@ -162,7 +164,7 @@ Add months or years to this `year_month_weekday`.
162164

163165
```cpp
164166
1) constexpr year_month_weekday& operator+=(const months& m) noexcept;
165-
2) year_month_weekday& operator+=(const years& y) noexcept;
167+
2) constexpr year_month_weekday& operator+=(const years& y) noexcept;
166168
```
167169

168170
### Parameters
@@ -226,7 +228,7 @@ The number of years to subtract.
226228

227229
`*this` which reflects the result of the subtraction.
228230

229-
### Example: `operator -=`
231+
### Example: `operator-=`
230232

231233
```cpp
232234
// compile using: /std:c++latest

0 commit comments

Comments
 (0)