Skip to content

Commit 3a8d2d6

Browse files
Taojunshengcampbell-msft3836425+corob-msft@users.noreply.github.comPRMerger6PRMerger12
authored
9/16/2021 AM Publish (#3776)
* Clean up documentation for "unspecified" architecture * Markdown quality fixes 1 of N * Markdown quality fixes 2 of N * Markdown quality fixes 3 of N * Markdown quality fixes 4 of N * Markdown quality fixes 5 of N * Markdown quality fixes 6 of N * Markdown quality fixes 7 of N * Markdown quality fixes 8 of N * Markdown quality fixes 9 of N * Markdown quality fixes 10 of N * Undo TN038 * Markdown quality fixes 11 of N * Setting PATH allows DUMPBIN to be executed from the system command prompt. There are multiple DUMPBIN.EXE's in the MSVC folder, but they can be executed if the PATH is set correctly. If this is not true, or undesireable per system design constraints, please clarify otherwise. * Call out toolchains and embedded scenarios * Add link to environment setting instructions * Make more readable * Address cpp-docs 3286 Postfix increment, decrement syntax (MicrosoftDocs#3711) * Address cpp-docs issue 3286 * Fix formatting, final example * Add compiler warning C5243, C5249, C5250 (MicrosoftDocs#3710) * Removing linux and non-windows bullet point * Make clear it's not required to meet all conditions Add "or" to final bullet point * PR review edit, Microsoft style for lists * Make the "unspecified" architecture option more general * Add __SANITIZE_ADDRESS__ to predefined macros page Noticed __SANITIZE_ADDRESS__ was missing from this list. * Add VS version Also note the VS version where __SANITIZE_ADDRESS__ was added in. * Add docs on using existing cache without cmake-server * Fix unescaped <chrono> (MicrosoftDocs#3715) Noticed this while doing other changes. Without being in a code block, <chrono> becomes the html element of the same name. * Address issue 3301 * Create and integrate /Zc:lambda article (#3719) * Create and integrate /Zc:lambda article * Fix conformance topic date * First half of C++20 changes * The other half of the /std:c++20 fixes * Fix link * Update cmake-projects-in-visual-studio.md * Remove duplicate line in build TOC * tech review * fixes * Cleanup per review * Update thread-class.md * Update future-functions.md * Update execution.md * Update execution.md * Update execution.md * Update future-functions.md * Update thread-class.md * Update execution.md * Update future-functions.md * Update thread-class.md * updates per tech review and other * added file_clock * Update execution.md * Update future-functions.md * Update thread-class.md * add gps_clock * update metadata * PR review edit, relative links * PR review edit, relative links * PR review edit, relative link * Fixed typo in bit-functions.md * Further typo fix * finished draft for local_t * acrolinx * Fixed broken links * incorp tech review * update typedef sections * add all related typedefs * fix tables * acrolinx * cleanup * fix links * fix tables * more table cleanup * another fix for tables. error msgs aren't by the error but I think I finally found the issue * one more table fix * typos * typo in code example * Update links to ARM docs (#3735) * Update links to ARM docs * Acrolinx and formatting pass * Acrolinx * Fix locale_t -> _locale_t * Update output-file-stream-member-functions.md Updated some code escapes for localization * Address github issues (MicrosoftDocs#3737) * fix github 3268 code example for Context::Yield() * fixed github #3312 - MFC CWnd::OnMouseHWheel description * Fix for github #3259-clarify change in the UI * acrolinx Co-authored-by: TylerMSFT <[email protected]> * Update how-to-convert-standard-string-to-system-string.md Fixing example. ------- cc: @TylerMSFT GitHub Issue: https://github.com/MicrosoftDocs/cpp-docs/issues/2438 * 16.11 Add /Zc:char8_t compiler option * PR review edit, date * Typo: B::f instead of B::F * Add u8 C++20 changes * Add io.h header into example code Repro: 1. Paste sample code for _get_errno is placed into new Visual Studio 2019 project 1. Try to compile Result: Compilation fails The error is: Error C3861 '_sopen_s': identifier not found Expected Result: Sample code should just compile Fix: Add io.h header file to avoid the above error in sample code. * Address 3340 Static member access in example * add Git screenshots and Git text * edit Git text and screenshot locale info * fix Version Control link error * move new Git content to the right moniker section * Remove unneeded share.h from sample code in errno documentation * Update docs/get-started/tutorial-console-cpp.md * Fixed typo in constructors-cpp.md * draft * added time_zone_link class * Update filesystem header explanation * fix links * Update filesystem.md Updated freshness date * add last_spec * 16.11 Refine applicability of /std:c++20 * a little more color around what a local_time is * simplify syntax block per style decision * add code example * acronlinx updates * arcolinx * Apply suggestions from code review * Address 3361 redist xp support * Fix moniker and duplication issues * Fix MicrosoftDocs/cpp-docs/issues/3355 msbuild * Fix missing line breaks * stdexcept docs: Update ms.date. * Explain how domain_error and range_error refer to math. * Mention that the STL doesn't throw domain_error or underflow_error. * Add parens to `message.data()` for consistency with other docs. * Overhaul all stdexcept examples. * `/GR` is enabled by default. * We don't need `/MDd`. * Include all necessary headers. * Improve paren/brace/bracket consistency. * Add constness when catching `const exception&`. * Rename to `invalid_argument.cpp`, matching the type exactly. * `bitset` can be directly constructed from `const char *`, we don't need `string`. * Shadowing the `bitset` type with a `bitset` variable is confusing; rename to `b`. * Always print colons in `"Caught: "` and `"Type: "` for consistency. * Regenerate all outputs with VS 2022 17.0 Preview 3, some exception messages changed slightly. * Massively simplify the `length_error` example and remove non-Standard code. * Change the `logic_error` string to `"Does not compute!"` to avoid potential confusion. * Drop unnecessary comments like `// out_of_range`. * Always print the type - it was missing from the `out_of_range` example. * Consistently display the output as a comment at the end of the file. * In the `range_error` example, catch `const exception&` to demonstrate inheritance like all other examples. * Fix set algorithm complexities. * Add a new page for latest redist downloads * Minor fixes to the latest supported vc redist page * Additional fixes for latest-supported-vc-redist * Update table of content * PR review edit * PR review edit * Copy Anju's MFC Chart update with new names (#3769) * update image * Code review feedback * tech review (#3767) * tech review * tech review * acrolinx * minor cleanup * formatting cleanup * cleanup Co-authored-by: TylerMSFT <[email protected]> * Fix validation warnings Fixes link issues in latest-supported-vc-redist.md Co-authored-by: Garrett Campbell <[email protected]> Co-authored-by: [email protected] <[email protected]> Co-authored-by: PRMerger6 <[email protected]> Co-authored-by: PRMerger12 <[email protected]> Co-authored-by: PRMerger14 <[email protected]> Co-authored-by: PRMerger16 <[email protected]> Co-authored-by: PRMerger15 <[email protected]> Co-authored-by: PRMerger7 <[email protected]> Co-authored-by: PRMerger10 <[email protected]> Co-authored-by: opbld16 <[email protected]> Co-authored-by: David Dyck <[email protected]> Co-authored-by: opbld17 <[email protected]> Co-authored-by: TylerMSFT <[email protected]> Co-authored-by: Kristine Toliver <[email protected]> Co-authored-by: Steve Wishnousky <[email protected]> Co-authored-by: opbld15 <[email protected]> Co-authored-by: Sam Freed <[email protected]> Co-authored-by: Don Spencer <[email protected]> Co-authored-by: Beau Braig <[email protected]> Co-authored-by: Alex Guteniev <[email protected]> Co-authored-by: Paula Miller <[email protected]> Co-authored-by: RibShark <[email protected]> Co-authored-by: Tyler Whitney <[email protected]> Co-authored-by: onihusube <[email protected]> Co-authored-by: PRMerger8 <[email protected]> Co-authored-by: Chris Ho <[email protected]> Co-authored-by: Andrew Rogers <[email protected]> Co-authored-by: Sauparna Palchowdhury <[email protected]> Co-authored-by: Nikolai Aristov <[email protected]> Co-authored-by: Terry G. Lee <[email protected]> Co-authored-by: PRMerger20 <[email protected]> Co-authored-by: Andrea Courtright <[email protected]> Co-authored-by: rayz-bee <[email protected]> Co-authored-by: Stephan T. Lavavej <[email protected]> Co-authored-by: Mahmoud Saleh <{ID}+{username}@users.noreply.github.com> Co-authored-by: Courtney Wales <[email protected]>
1 parent f6212ac commit 3a8d2d6

File tree

6 files changed

+143
-28
lines changed

6 files changed

+143
-28
lines changed

docs/standard-library/chrono.md

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
---
22
description: "Learn more about: <chrono>"
33
title: "<chrono>"
4-
ms.date: 09/02/2021
4+
ms.date: 09/15/2021
55
f1_keywords: ["<chrono>", "chrono/std::chrono::nanoseconds", "chrono/std::chrono::minutes", "chrono/std::chrono::seconds", "chrono/std::chrono::hours", "chrono/std::chrono::milliseconds", "chrono/std::chrono::microseconds"]
66
---
77

88
# `<chrono>`
99

1010
Include the standard header `<chrono>` to define classes and functions that represent and manipulate time durations and time instants.
1111

12-
Beginning in Visual Studio 2015, the implementation of `steady_clock` has changed to meet the C++ Standard requirements for steadiness and monotonicity. `steady_clock` is now based on `QueryPerformanceCounter()`, and `high_resolution_clock` is now a typedef for `steady_clock`. As a result, in the Microsoft C++ compiler `steady_clock::time_point` is now a `typedef` for `chrono::time_point<steady_clock>`; however, this rule isn't necessarily the case for other implementations.
12+
Beginning in Visual Studio 2015, the implementation of `steady_clock` has changed to meet the C++ Standard requirements for steadiness and monotonicity:
13+
- `steady_clock` is now based on `QueryPerformanceCounter()`
14+
- `high_resolution_clock` is now a typedef for `steady_clock`
15+
In the Microsoft C++ implementation, `steady_clock::time_point` is now a `typedef` for `chrono::time_point<steady_clock>`. However, this isn't necessarily the case for other implementations.
1316

1417
## Requirements
1518

@@ -26,7 +29,7 @@ Beginning in Visual Studio 2015, the implementation of `steady_clock` has change
2629
| [`duration` class](duration-class.md) | A time interval. |
2730
|[`duration_values` struct](duration-values-structure.md)|Provides specific values for the `duration` template parameter `Rep`.|
2831
| [`hh_mm_ss` class](hhmmss-class.md) | Splits a [`duration`](duration-class.md) into hours:minutes:seconds. |
29-
| [`last_spec`](last-spec-struct.md) | Used to indicate the last item in a sequence, such as the last day of the week, when creating a calendrical type. |
32+
| [`last_spec`](last-spec-struct.md) | Used to indicate the last item in a month such as last day of the week of a month (the last Tuesday of February 2020) or the last day of a month (the last day of April 2019). |
3033
| [`leap_second` class](leap-second-class.md) | A date and a value for an inserted leap second. |
3134
|[`leap_second_info` struct](leap-second-info-struct.md) | The data returned by [`get_leap_second_info`](chrono-functions.md#std-chrono-get-leap-second-info). |
3235
| [`month` class](month-class.md) | A month of a year. For example, July. |
@@ -49,21 +52,21 @@ Beginning in Visual Studio 2015, the implementation of `steady_clock` has change
4952

5053
| Name | Description |
5154
|--|--|
52-
|[`file_clock` class](file-clock-class.md)| A clock that is an alias for the clock used for `std::filesystem::file_time_type` used to express file timestamps.|
55+
|[`file_clock` class](file-clock-class.md)| An alias for the clock used for `std::filesystem::file_time_type`, which is used to express file timestamps.|
5356
|[`gps_clock` class](gps-clock-class.md)| A clock that keeps GPS time. Measures time starting from the first Sunday of January 1980 at 00:00:00 UTC.|
5457
|[`high_resolution_clock` struct](high-resolution-clock-struct.md)| A clock with a nanosecond tick period. |
55-
|[`local_t` struct](local_t.md)| A pseudo-clock used as an argument to the `time_point` template argument to indicate that the time_point represents local time. |
56-
|[`steady_clock` struct](steady-clock-struct.md)|A `steady` clock. Preferred for measuring time intervals. |
57-
|[`system_clock` struct](system-clock-structure.md)|A *`clock type`* that is based on the real-time clock of the system.|
58-
|[`tai_clock` class](tai-clock-class.md)| Measures International Atomic Time (TAI) starting from Thursday, January 1, 1958 at 00:00:00. Doesn't account for leap seconds.|
59-
|[`utc_clock` class](utc-clock-class.md)| Measures time since 00:00:00 UTC on Thursday, January 1, 1970. This clock accounts for leap seconds and is the time standard used around the world.|
58+
|[`local_t` struct](local_t.md)| A pseudo-clock used as an argument to the `time_point` template to indicate that the `time_point` represents local time. |
59+
|[`steady_clock` struct](steady-clock-struct.md)|A `steady` clock. This clock is preferred for measuring time intervals. |
60+
|[`system_clock` struct](system-clock-structure.md)|A clock based on the real-time clock of the system.|
61+
|[`tai_clock` class](tai-clock-class.md)| Measures International Atomic Time (TAI) starting from Thursday, January 1, 1958 at 00:00:00. This clock doesn't account for leap seconds.|
62+
|[`utc_clock` class](utc-clock-class.md)| Measures time since 00:00:00 UTC on Thursday, January 1, 1970. This clock accounts for leap seconds, and is the time standard used around the world.|
6063

6164
**Time Zones**
6265

6366
| Name | Description |
6467
|--|--|
6568
| [`time_zone` class](time-zone-class.md) | All time zone transitions for a specific geographic area. |
66-
| [`time_zone_link` class](time-zone-link-class.md) | Specifies an alternative name for a `time_zone`. |
69+
| [`time_zone_link` class](time-zone-link-class.md) | An alternative name for a `time_zone`. |
6770

6871
## Functions
6972

@@ -121,8 +124,8 @@ For more information about ratio types that are used in the following typedefs,
121124
| Name | Description |
122125
|--|--|
123126
| `typedef duration<long long, nano> nanoseconds;` | Synonym for a `duration` type that has a tick period of one billionth (1/1,000,000,000) of a second. |
124-
| `typedef duration<long long, micro> microseconds;` | Synonym for a `duration` type that has a tick period of one millionth (1/1,000,000) of a second. |
125-
| `typedef duration<long long, milli> milliseconds;` | Synonym for a `duration` type that has a tick period of one thousandth (1/1,000) of a second. |
127+
| `typedef duration<long long, micro> microseconds;` | Synonym for a `duration` type that has a tick period of one-millionth (1/1,000,000) of a second. |
128+
| `typedef duration<long long, milli> milliseconds;` | Synonym for a `duration` type that has a tick period of one-thousandth (1/1,000) of a second. |
126129
| `typedef duration<long long> seconds;` | Synonym for a `duration` type that has a tick period of 1 second. |
127130
| `typedef duration<int, ratio<60>> minutes;` | Synonym for a `duration` type that has a tick period of 1 minute. |
128131
| `typedef duration<int, ratio<3600>> hours;` | Synonym for a `duration` type that has a tick period of 1 hour. |
@@ -132,17 +135,17 @@ For more information about ratio types that are used in the following typedefs,
132135
| Name | Description |
133136
|--|--|
134137
| `file_time` | A synonym for `template <class Duration> using file_time = time_point<file_clock, Duration>`. Represents a [`time_point`](time-point-class.md) for a [`file_clock`](file-clock-class.md). You specify the `Duration`. |
135-
| `gps_seconds` | A synonym for `using gps_seconds = gps_time<seconds>;` A count of seconds, represented by a `time_point` that is associated with a [`gps_clock`](tai-clock-class.md). |
138+
| `gps_seconds` | A synonym for `gps_time<seconds>;` A count of seconds, represented by a `time_point` that is associated with a [`gps_clock`](tai-clock-class.md). |
136139
| `gps_time` | A synonym for `template <class Duration> using gps_time = time_point<gps_clock, Duration>`. Represents a `time_point` for a [`gps_clock`](gps-clock-class.md). You specify the `Duration`. |
137-
| `local_days` | A synonym for `using local_days = local_time<days>`. A count of days, represented by a [`time_point`](time-point-class.md) that isn't associated with any time zone. |
140+
| `local_days` | A synonym for `local_time<days>`. A count of days, represented by a [`time_point`](time-point-class.md) that isn't associated with any time zone. |
138141
| `local_seconds` | A synonym for `local_time<seconds>`. Defined in `std::chrono`. |
139-
| `local_time` | A synonym for `template <class Duration> using local_time = time_point<local_t, Duration>`. Represents a `time_point` for a local time. You specify the `Duration`. A `local_time` isn't associated with a time zone yet. It isn't the current local time of your computer's clock Only when you pair a `local_time` with a `time_zone` do you get a point in time that can be converted to UTC or other time in a specific time zone. |
140-
| `sys_days` | A synonym for `using sys_days = sys_time<days>`. A count of days, represented by a `time_point` that is associated with a [`system_clock`](system-clock-structure.md). |
141-
| `sys_seconds` | A synonym for `using sys_seconds = sys_time<seconds>`. A count of seconds, represented by a `time_point` that is associated with a [`system_clock`](system-clock-structure.md). |
142+
| `local_time` | A synonym for `template <class Duration> using local_time = time_point<local_t, Duration>`. Represents a `time_point` for a local time. You specify the `Duration`. A `local_time` isn't associated with a time zone yet. It isn't the current local time of your computer's clock. Only when you pair a `local_time` with a `time_zone` do you get a point in time that can be converted to UTC or other time in a specific time zone. |
143+
| `sys_days` | A synonym for `sys_time<days>`. A count of days, represented by a `time_point` that is associated with a [`system_clock`](system-clock-structure.md). |
144+
| `sys_seconds` | A synonym for `sys_time<seconds>`. A count of seconds, represented by a `time_point` that is associated with a [`system_clock`](system-clock-structure.md). |
142145
| `sys_time` | A synonym for `template <class Duration> using sys_time = time_point<system_clock, Duration>`. Represents a `time_point` for a [`system_clock`](system-clock-structure.md). You specify the `Duration`. |
143-
| `tai_seconds` | A synonym for `using tai_seconds = tai_time<seconds>` A count of seconds, represented by a `time_point` that is associated with a [`tai_clock`](tai-clock-class.md). |
146+
| `tai_seconds` | A synonym for `tai_time<seconds>` A count of seconds, represented by a `time_point` that is associated with a [`tai_clock`](tai-clock-class.md). |
144147
| `tai_time` | A synonym for `template <class Duration> using tai_time = time_point<tai_clock, Duration>`. Represents a `time_point` for a [`tai_clock`](tai-clock-class.md). You specify the `Duration`. |
145-
| `utc_seconds` | A synonym for `using utc_seconds = utc_time<seconds>;` |
148+
| `utc_seconds` | A synonym for `utc_time<seconds>;` |
146149
| `utc_time` | A synonym for `template<class Duration> using utc_time = time_point<utc_clock, Duration>`. Represents a `time_point`for a [`utc_clock`](utc-clock-class.md). You specify the `Duration`. |
147150

148151
## Type traits

docs/standard-library/last-spec-struct.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
---
22
description: "Learn more about: last_spec struct"
33
title: "last_spec struct"
4-
ms.date: 09/02/2021
4+
ms.date: 09/15/2021
55
f1_keywords: ["chrono/std::chrono::last_spec"]
66
---
77

88
# last_spec struct
99

10-
Indicates the last item in a sequence, such as the last Monday of December, the last day of the month, and so on.
10+
Used to indicate the last item in a month, such as last day of the week of a month (the last Tuesday of February 2020) or the last day of a month (the last day of April 2019).
1111

1212
## Syntax
1313

@@ -16,9 +16,12 @@ struct last_spec; // C++20
1616
inline constexpr last_spec last{} // C++20
1717
```
1818

19-
## Remarks
19+
## <a name="example"></a> Example: `last`
2020

21-
Use this struct when creating calendrical types to indicate the last item in a sequence. When you specify `last` while creating a calendrical type like `month_day_last`, you're passing a `last_spec` to indicate that you want the last day in the month. For example:
21+
Use `last_spec` to indicate the last item in a month. The following example uses `last` to indicate the:
22+
- last day in December as a `monthDayLast`
23+
- last Friday in July of 2021 as a `year_month_weekday_last`
24+
- last day in April of 1975 as a `year_month_day_last`
2225

2326
```cpp
2427
// compile using: /std:c++latest
@@ -35,13 +38,17 @@ int main()
3538
constexpr auto yearMonthWeekDayLast{year(2021)/July/Friday[last]}; // 'last' resolves to last_spec
3639
std::cout << yearMonthWeekDayLast << '\n';
3740

41+
constexpr auto yearMonthDayLast{ April / last / 1975 };
42+
std::cout << yearMonthDayLast << "\n";
43+
3844
return 0;
3945
}
4046
```
4147

4248
```output
4349
Dec/last
4450
2021/Jul/Fri[last]
51+
1975/Apr/last
4552
```
4653

4754
## Members
@@ -68,11 +75,11 @@ explicit last_spec() = default;
6875

6976
### Remarks
7077

71-
You typically won't create a `last_spec` instance directly. You'll use `last` as shown in the first example.
78+
You typically won't create a `last_spec` instance directly. You'll use `last` as shown above in [Example `last`](#example).
7279

7380
## See also
7481

7582
[`<chrono>`](chrono.md)\
7683
[`month_day_last` Class](month-day-last-class.md)\
7784
[`month_weekday_last` class](month-weekday-last-class.md)\
78-
[Header Files Reference](cpp-standard-library-header-files.md)
85+
[Header Files Reference](cpp-standard-library-header-files.md)

docs/standard-library/time-zone-link-class.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: "Learn more about: time_zone_link class"
33
title: "time_zone_link class"
4-
ms.date: 9/1/2021
4+
ms.date: 9/15/2021
55
f1_keywords: ["chrono/std::chrono::time_zone_link::name", "chrono/std::chrono::time_zone_link::target"]
66
helpviewer_keywords: ["std::chrono [C++], time_zone_link class", "std::chrono::time_zone_link::name function", "std::chrono::time_zone_link::target function"]
77
---
@@ -17,10 +17,17 @@ class time_zone_link; // Since C++20
1717

1818
## Remarks
1919

20-
`time_zone_link` instances are created when the time zone database is initialized. They can't be created by the developer. You can get them with `get_tzdb().links` as shown in the example at the end of this topic.
20+
`time_zone_link` instances are created when the time zone database is initialized. They can't be created directly. Get an instance via `get_tzdb().links`, as shown in the example at the end of this topic.
2121

2222
Although this type has a default move constructor and move assignment operator, it isn't copyable because only `const` access is provided to this type. Using those functions results in undefined behavior, which is why the move constructor and assignment operator aren't listed here.
2323

24+
**Differences with IANA database**
25+
26+
In Microsoft's implementation, time zone data can differ in some cases from the Internet Assigned Numbers Authority (IANA) time zone database. For example, `"America/Nuuk"` is returned instead of `"America/Godthab"` (`"America/Nuuk"` was renamed `"America/Godthab"` in April 2020). We don't supply the `"Eastern War Time EWT"` time zone at this time. See [Issue #1786](https://github.com/microsoft/STL/issues/1786) on the Microsoft STL GitHub repo for more details.
27+
28+
> [!NOTE]
29+
> At this time, time-zone data is only available on Windows version 19H1, and later. If you’re running on a version earlier than 19H1, you’ll get an exception: "The specified module could not be found".
30+
2431
## Members
2532

2633
### Public member functions and function templates

0 commit comments

Comments
 (0)