Skip to content

Commit fd1a003

Browse files
authored
Merge pull request #2390 from corob-msft/cr-stl-16.3
Update breaking change to 16.3 headers per STL
2 parents 7e6699c + 4763114 commit fd1a003

File tree

4 files changed

+28
-24
lines changed

4 files changed

+28
-24
lines changed

docs/cpp/bad-cast-exception.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "bad_cast Exception"
3-
ms.date: "11/04/2016"
3+
ms.date: "10/04/2019"
44
f1_keywords: ["bad_cast", "bad_cast_cpp"]
55
helpviewer_keywords: ["exceptions [C++], bad_cast", "bad_cast keyword [C++]"]
66
ms.assetid: 31eae1e7-d8d5-40a0-9fef-64a6a4fc9021
@@ -29,7 +29,7 @@ The following code contains an example of a failed **dynamic_cast** that throws
2929
```cpp
3030
// expre_bad_cast_Exception.cpp
3131
// compile with: /EHsc /GR
32-
#include <typeinfo.h>
32+
#include <typeinfo>
3333
#include <iostream>
3434
3535
class Shape {
@@ -55,7 +55,7 @@ int main() {
5555
}
5656
```
5757

58-
The exception is thrown because the object being cast (a Shape) is not derived from the specified cast type (Circle). To avoid the exception, add these declarations to `main`:
58+
The exception is thrown because the object being cast (a Shape) isn't derived from the specified cast type (Circle). To avoid the exception, add these declarations to `main`:
5959

6060
```cpp
6161
Circle circle_instance;
@@ -113,6 +113,6 @@ const char* what() const noexcept override;
113113

114114
## See also
115115

116-
[dynamic_cast Operator](../cpp/dynamic-cast-operator.md)<br/>
117-
[Keywords](../cpp/keywords-cpp.md)<br/>
118-
[C++ Exception Handling](../cpp/cpp-exception-handling.md)
116+
[dynamic_cast Operator](../cpp/dynamic-cast-operator.md)\
117+
[Keywords](../cpp/keywords-cpp.md)\
118+
[C++ Exception Handling](../cpp/cpp-exception-handling.md)

docs/cpp/bad-typeid-exception.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "bad_typeid Exception"
3-
ms.date: "11/04/2016"
3+
ms.date: "10/04/2019"
44
f1_keywords: ["bad_typeid", "bad_typeid_cpp"]
55
helpviewer_keywords: ["bad_typeid exception", "exceptions [C++], bad_typeid"]
66
ms.assetid: 5963ed58-4ede-4597-957d-f7bbd06299c2
@@ -39,7 +39,7 @@ The following example shows the **typeid** operator throwing a **bad_typeid** ex
3939
```cpp
4040
// expre_bad_typeid.cpp
4141
// compile with: /EHsc /GR
42-
#include <typeinfo.h>
42+
#include <typeinfo>
4343
#include <iostream>
4444
4545
class A{
@@ -70,5 +70,5 @@ Object is NULL
7070

7171
## See also
7272

73-
[Run-Time Type Information](../cpp/run-time-type-information.md)<br/>
74-
[Keywords](../cpp/keywords-cpp.md)
73+
[Run-Time Type Information](../cpp/run-time-type-information.md)\
74+
[Keywords](../cpp/keywords-cpp.md)

docs/cpp/typeid-operator.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "typeid Operator"
3-
ms.date: "11/04/2016"
3+
ms.date: "10/04/2019"
44
helpviewer_keywords: ["typeid operator"]
55
ms.assetid: 8871cee6-d6b9-4301-a5cb-bf3dc9798d61
66
---
@@ -17,25 +17,25 @@ typeid(expression)
1717

1818
The **typeid** operator allows the type of an object to be determined at run time.
1919

20-
The result of **typeid** is a `const type_info&`. The value is a reference to a `type_info` object that represents either the *type-id* or the type of the *expression*, depending on which form of **typeid** is used. See [type_info Class](../cpp/type-info-class.md) for more information.
20+
The result of **typeid** is a `const type_info&`. The value is a reference to a `type_info` object that represents either the *type-id* or the type of the *expression*, depending on which form of **typeid** is used. For more information, see [type_info Class](../cpp/type-info-class.md).
2121

22-
The **typeid** operator does not work with managed types (abstract declarators or instances), see [typeid](../extensions/typeid-cpp-component-extensions.md) for information on getting the <xref:System.Type> of a specified type.
22+
The **typeid** operator doesn't work with managed types (abstract declarators or instances). For information on getting the <xref:System.Type> of a specified type, see [typeid](../extensions/typeid-cpp-component-extensions.md).
2323

24-
The **typeid** operator does a run-time check when applied to an l-value of a polymorphic class type, where the true type of the object cannot be determined by the static information provided. Such cases are:
24+
The **typeid** operator does a run-time check when applied to an l-value of a polymorphic class type, where the true type of the object can't be determined by the static information provided. Such cases are:
2525

2626
- A reference to a class
2727

28-
- A pointer, dereferenced with \*
28+
- A pointer, dereferenced with `*`
2929

30-
- A subscripted pointer (i.e. [ ]). (Note that it is generally not safe to use a subscript with a pointer to a polymorphic type.)
30+
- A subscripted pointer (`[ ]`). (It's not safe to use a subscript with a pointer to a polymorphic type.)
3131

32-
If the *expression* points to a base class type, yet the object is actually of a type derived from that base class, a `type_info` reference for the derived class is the result. The *expression* must point to a polymorphic type (a class with virtual functions). Otherwise, the result is the `type_info` for the static class referred to in the *expression*. Further, the pointer must be dereferenced so that the object it points to is used. Without dereferencing the pointer, the result will be the `type_info` for the pointer, not what it points to. For example:
32+
If the *expression* points to a base class type, yet the object is actually of a type derived from that base class, a `type_info` reference for the derived class is the result. The *expression* must point to a polymorphic type (a class with virtual functions). Otherwise, the result is the `type_info` for the static class referred to in the *expression*. Further, the pointer must be dereferenced so that the object used is the one it points to. Without dereferencing the pointer, the result will be the `type_info` for the pointer, not what it points to. For example:
3333

3434
```cpp
3535
// expre_typeid_Operator.cpp
3636
// compile with: /GR /EHsc
3737
#include <iostream>
38-
#include <typeinfo.h>
38+
#include <typeinfo>
3939

4040
class Base {
4141
public:
@@ -56,9 +56,9 @@ int main() {
5656
}
5757
```
5858
59-
If the *expression* is dereferencing a pointer, and that pointer's value is zero, **typeid** throws a [bad_typeid exception](../cpp/bad-typeid-exception.md). If the pointer does not point to a valid object, a `__non_rtti_object` exception is thrown, indicating an attempt to analyze the RTTI that triggered a fault (like access violation), because the object is somehow invalid (bad pointer or the code wasn't compiled with [/GR](../build/reference/gr-enable-run-time-type-information.md)).
59+
If the *expression* is dereferencing a pointer, and that pointer's value is zero, **typeid** throws a [bad_typeid exception](../cpp/bad-typeid-exception.md). If the pointer doesn't point to a valid object, a `__non_rtti_object` exception is thrown. It indicates an attempt to analyze the RTTI that triggered a fault because the object is somehow invalid. (For example, it's a bad pointer, or the code wasn't compiled with [/GR](../build/reference/gr-enable-run-time-type-information.md)).
6060
61-
If the *expression* is neither a pointer nor a reference to a base class of the object, the result is a `type_info` reference representing the static type of the *expression*. The *static type* of an expression refers to the type of an expression as it is known at compile time. Execution semantics are ignored when evaluating the static type of an expression. Furthermore, references are ignored when possible when determining the static type of an expression:
61+
If the *expression* is not a pointer, and not a reference to a base class of the object, the result is a `type_info` reference representing the static type of the *expression*. The *static type* of an expression refers to the type of an expression as it is known at compile time. Execution semantics are ignored when evaluating the static type of an expression. Furthermore, references are ignored when possible when determining the static type of an expression:
6262
6363
```cpp
6464
// expre_typeid_Operator_2.cpp
@@ -85,5 +85,5 @@ T max( T arg1, T arg2 ) {
8585
8686
## See also
8787
88-
[Run-Time Type Information](../cpp/run-time-type-information.md)<br/>
89-
[Keywords](../cpp/keywords-cpp.md)
88+
[Run-Time Type Information](../cpp/run-time-type-information.md)\
89+
[Keywords](../cpp/keywords-cpp.md)

docs/overview/cpp-conformance-improvements.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "C++ conformance improvements"
3-
ms.date: "09/25/2019"
3+
ms.date: "10/04/2019"
44
description: "Microsoft C++ in Visual Studio is progressing toward full conformance with the C++20 language standard."
55
ms.technology: "cpp-language"
66
author: "mikeblome"
@@ -451,6 +451,10 @@ extern "C" void f(int, int, int, BOOL){}
451451
452452
To avoid the errors in the previous example, use **bool** instead of **BOOL** consistently in both declarations of `f`.
453453
454+
### Standard Library improvements
455+
456+
The non-standard headers \<stdexcpt.h> and \<typeinfo.h> have been removed. Code that includes them should instead include the standard headers \<exception> and \<typeinfo>, respectively.
457+
454458
## <a name="update_160"></a> Bug fixes and behavior changes in Visual Studio 2019
455459
456460
### Reinterpret_cast in a constexpr function
@@ -716,7 +720,7 @@ The unordered container `reserve` function now actually reserves for N elements,
716720
717721
- Previously, some time values that were passed to the concurrency library would overflow, for example, `condition_variable::wait_for(seconds::max())`. Now fixed, the overflows changed behavior on a seemingly random 29-day cycle (when uint32_t milliseconds accepted by underlying Win32 APIs overflowed).
718722
719-
- The <ctime> header now correctly declares `timespec` and `timespec_get` in namespace `std` in addition to declaring them in the global namespace.
723+
- The \<ctime> header now correctly declares `timespec` and `timespec_get` in namespace `std` in addition to declaring them in the global namespace.
720724
721725
### Various fixes for containers
722726

0 commit comments

Comments
 (0)