Skip to content

Commit 746772a

Browse files
author
msebolt
committed
changes per @mikeblome
1 parent 7d70400 commit 746772a

3 files changed

Lines changed: 106 additions & 12 deletions

File tree

docs/cpp/bad-cast-exception.md

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,7 @@ catch (bad_cast)
2121
The interface for **bad_cast** is:
2222

2323
```cpp
24-
class bad_cast : public exception {
25-
public:
26-
bad_cast(const char * _Message = "bad cast");
27-
bad_cast(const bad_cast &);
28-
virtual ~bad_cast();
29-
30-
bad_cast& operator=(const bad_cast&) noexcept;
31-
const char* what() const noexcept override;
32-
};
24+
class bad_cast : public exception
3325
```
3426
3527
The following code contains an example of a failed **dynamic_cast** that throws the **bad_cast** exception.
@@ -76,6 +68,51 @@ Then reverse the sense of the cast in the **try** block as follows:
7668
Shape& ref_shape = dynamic_cast<Shape&>(ref_circle);
7769
```
7870

71+
## Members
72+
73+
### Constructors
74+
75+
|Constructor|Description|
76+
|-|-|
77+
|[bad_cast](#bad_cast)|The constructor for objects of type `bad_cast`.|
78+
79+
### Functions
80+
81+
|Function|Description|
82+
|-|-|
83+
|[what](#what)|No description.|
84+
85+
### Operators
86+
87+
|Operator|Description|
88+
|-|-|
89+
|[operator=](#op_eq)|An assignment operator that assigns one `bad_cast` object to another.|
90+
91+
## <a name="bad_cast"></a> bad_cast::bad_cast
92+
93+
The constructor for objects of type `bad_cast`.
94+
95+
```cpp
96+
bad_cast(const char * _Message = "bad cast");
97+
bad_cast(const bad_cast &);
98+
```
99+
100+
## <a name="op_eq"></a> bad_cast::operator=
101+
102+
An assignment operator that assigns one `bad_cast` object to another.
103+
104+
```cpp
105+
bad_cast& operator=(const bad_cast&) noexcept;
106+
```
107+
108+
## <a name="what"></a> bad_cast::what
109+
110+
No description.
111+
112+
```cpp
113+
const char* what() const noexcept override
114+
```
115+
79116
## See also
80117

81118
[dynamic_cast Operator](../cpp/dynamic-cast-operator.md)<br/>
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
title: "default_delete Struct"
3+
ms.date: "04/04/2019"
4+
f1_keywords: ["memory/std::default_delete"]
5+
helpviewer_keywords: ["default_delete struct"]
6+
---
7+
# default_delete Struct
8+
9+
A predefined function object that performs the division operation (`operator/`) on its arguments.
10+
11+
## Syntax
12+
13+
```cpp
14+
template <class T>
15+
struct default_delete
16+
```
17+
18+
## Requirements
19+
20+
**Header:** \<memory>
21+
22+
**Namespace:** std
23+
24+
## Members
25+
26+
### Constructors
27+
28+
|Constructor|Description|
29+
|-|-|
30+
|[default_delete](#default_delete)|The constructor for objects of type `default_delete`.|
31+
32+
### Operators
33+
34+
|Operator|Description|
35+
|-|-|
36+
|[operator()](#op_paren)|A reference operator to access `default_delete`.|
37+
38+
## <a name="default_delete"></a> default_delete::default_delete
39+
40+
The constructor for objects of type `default_delete`.
41+
42+
```cpp
43+
constexpr default_delete() noexcept = default;
44+
template <class U>
45+
default_delete(const default_delete<U>&) noexcept;
46+
```
47+
48+
## <a name="op_paren"></a> default_delete::operator()
49+
50+
A reference operator to access `default_delete`.
51+
52+
```cpp
53+
void operator()(T*) const;
54+
```
55+
56+
## See also
57+
58+
[\<memory>](../standard-library/memory.md)

docs/standard-library/memory.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
---
22
title: "&lt;memory&gt;"
3-
ms.date: "11/04/2016"
3+
ms.date: "04/04/2019"
44
f1_keywords: ["memory/std::<memory>", "<memory>", "std::<memory>"]
55
helpviewer_keywords: ["memory header"]
6-
ms.assetid: ef8e38da-7c9d-4037-9ad1-20c99febf5dc
76
---
87
# &lt;memory&gt;
98

@@ -85,7 +84,7 @@ Defines a class, an operator, and several templates that help allocate and free
8584

8685
|Structure|Description|
8786
|-|-|
88-
|[default_delete](../standard-library/default-delete-structure.md)||
87+
|[default_delete](../standard-library/default-delete-struct.md)||
8988
|[owner_less](../standard-library/memory-functions.md#owner_less)|Allows ownership-based mixed comparisons of shared and weak pointers.|
9089

9190
### Specializations

0 commit comments

Comments
 (0)