Skip to content

Commit a06d3f8

Browse files
TylerMSFTTylerMSFT
authored andcommitted
fix alt-text for images to be descriptive
1 parent 29114d5 commit a06d3f8

7 files changed

Lines changed: 32 additions & 22 deletions

File tree

‎docs/cpp/cpp-bit-fields.md‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ description: "Learn more about: C++ Bit Fields"
33
title: "C++ Bit Fields"
44
ms.date: "11/19/2018"
55
helpviewer_keywords: ["bitfields [C++]", "fields [C++], bit", "bit fields"]
6-
ms.assetid: 6f4b62e3-cc1d-4e5d-bf34-05904104f71a
76
---
87
# C++ Bit Fields
98

@@ -35,8 +34,9 @@ struct Date {
3534
3635
The conceptual memory layout of an object of type `Date` is shown in the following figure.
3736
38-
![Memory layout of a date object, showing the nWeekDay, nMonthDay, nMonth, and nYear bit fields.](../cpp/media/vc38uq1.png "Memory layout of a date object") <br/>
39-
Memory Layout of Date Object
37+
:::image type="complex" source="../cpp/media/vc38uq1.png" alt-text="Memory layout of a date object, showing where the nWeekDay, nMonthDay, nMonth, and nYear bit fields fall.":::
38+
32 bits of memory are displayed in a row. The rightmost 3 bits are for nWeekDay. The next 6 bits to the left are for nMonthDay. The next 5 bits to the left are for nMonth. The next two bits are unused. The next 8 bits are for nYear. The remaining 8 bits to the left are unused.
39+
:::image-end:::
4040
4141
Note that `nYear` is 8 bits long and would overflow the word boundary of the declared type, **`unsigned short`**. Therefore, it is begun at the beginning of a new **`unsigned short`**. It is not necessary that all bit fields fit in one object of the underlying type; new units of storage are allocated, according to the number of bits requested in the declaration.
4242
@@ -62,8 +62,9 @@ struct Date {
6262

6363
then the memory layout is as shown in the following figure:
6464

65-
![Layout of a Date object with a zero length bit field, which forces alignment padding.](../cpp/media/vc38uq2.png) <br/>
66-
Layout of Date Object with Zero-Length Bit Field
65+
:::image type="complex" source="../cpp/media/vc38uq2.png" alt-text="Layout of a Date object with a zero length bit field, which forces alignment padding.":::
66+
64 bits of memory are displayed in a row. The rightmost 5 bits are for nMonth. The next 8 bits to the left are for nYear. The next 19 bits to the left are unused. The next 3 bits to the left are for nWeekDay. The next 6 bits to the left are for nMonthDay. The remaining bits to the left are unused.
67+
:::image-end:::
6768

6869
The underlying type of a bit field must be an integral type, as described in [Built-in types](../cpp/fundamental-types-cpp.md).
6970

‎docs/cpp/dynamic-cast-operator.md‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ description: "Overview of the C++ language dynamic_cast operator."
44
ms.date: "02/03/2020"
55
f1_keywords: ["dynamic_cast_cpp"]
66
helpviewer_keywords: ["dynamic_cast keyword [C++]"]
7-
ms.assetid: f380ada8-6a18-4547-93c9-63407f19856b
87
---
98
# dynamic_cast Operator
109

@@ -114,8 +113,9 @@ int main() {
114113
}
115114
```
116115

117-
![Class hierarchy that shows multiple inheritance.](../cpp/media/vc39011.gif "Class hierarchy that shows multiple inheritance") <br/>
118-
Class hierarchy that shows multiple inheritance
116+
:::image type="complex" source="../cpp/media/vc39011.gif" alt-text="Class hierarchy that shows multiple inheritance.":::
117+
The diagram shows a class hierarchy with A as a base class of B which in turn is a base class of D. A is also a base class for C which in turn is a base class for D. Note that class D inherits from both B and C.
118+
:::image-end:::
119119

120120
A pointer to an object of type `D` can be safely cast to `B` or `C`. However, if `D` is cast to point to an `A` object, which instance of `A` would result? This would result in an ambiguous casting error. To get around this problem, you can perform two unambiguous casts. For example:
121121

@@ -137,14 +137,18 @@ void f() {
137137
138138
Further ambiguities can be introduced when you use virtual base classes. Consider the class hierarchy shown in the following figure.
139139
140-
![Class hierarchy that shows virtual base classes.](../cpp/media/vc39012.gif "Class hierarchy that shows virtual base classes") <br/>
140+
:::image type="complex" source="../cpp/media/vc39012.gif" alt-text="Class hierarchy that shows virtual base classes.":::
141+
The diagram shows the classes A, B, C, D, and E arranged as follows: Class A is a base class of B. Classes C and E each derive from B. Class E also inherits from D which inherits from class B which in turn inherits from class A.
142+
:::image-end:::
141143
Class hierarchy that shows virtual base classes
142144
143145
In this hierarchy, `A` is a virtual base class. Given an instance of class `E` and a pointer to the `A` subobject, a **`dynamic_cast`** to a pointer to `B` will fail due to ambiguity. You must first cast back to the complete `E` object, then work your way back up the hierarchy, in an unambiguous manner, to reach the correct `B` object.
144146
145147
Consider the class hierarchy shown in the following figure.
146148
147-
![Class hierarchy that shows duplicate base classes.](../cpp/media/vc39013.gif "Class hierarchy that shows duplicate base classes") <br/>
149+
:::image type="complex" source="../cpp/media/vc39013.gif" alt-text="Class hierarchy that shows duplicate base classes.":::
150+
The diagram shows the classes A, B, C, D, and E arranged as follows: Class B derives from Class A. Class C derives from class A. class D derives from class B. Class E derives from class C which derives from class A. In this case, the duplicate base class is class A which is directly or indirectly inherited by all the other classes. Class A is inherited directly by classes B and C, and indirectly by class D via class B, and indirectly by class E via class C, and indirectly in class D via class B.
151+
:::image-end:::
148152
Class hierarchy that shows duplicate base classes
149153
150154
Given an object of type `E` and a pointer to the `D` subobject, to navigate from the `D` subobject to the left-most `A` subobject, three conversions can be made. You can perform a **`dynamic_cast`** conversion from the `D` pointer to an `E` pointer, then a conversion (either **`dynamic_cast`** or an implicit conversion) from `E` to `B`, and finally an implicit conversion from `B` to `A`. For example:

‎docs/cpp/friend-cpp.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ title: "friend (C++)"
44
ms.date: 06/30/2022
55
f1_keywords: ["friend_cpp"]
66
helpviewer_keywords: ["member access, from friend functions", "friend classes [C++]", "friend keyword [C++]"]
7-
ms.assetid: 8fe9ee55-d56f-40cd-9075-d9fb1375aff4
87
---
98
# `friend` (C++)
109

@@ -225,8 +224,9 @@ Friendship isn't inherited, meaning that classes derived from `YourOtherClass` c
225224
226225
The following figure shows four class declarations: `Base`, `Derived`, `aFriend`, and `anotherFriend`. Only class `aFriend` has direct access to the private members of `Base` (and to any members `Base` might have inherited).
227226
228-
![Diagram showing the derivation implications of a friend relationship.](../cpp/media/vc38v41.gif "Implications of friend relationship") <br/>
229-
Implications of friend relationship
227+
::image type="complex" source="../cpp/media/vc38v41.gif" alt-text="Diagram showing the derivation implications of a friend relationship.":::
228+
The diagram shows that class anotherFriend doesn't have a friend relationship with class base which friends class aFriend. Class aFriend is friended by class Base, but it doesn't have a friend relationship with class Derived even though class Derived inherits from Base, thus showing that inheritance doesn't imply the derived class has the same friends as the base class.
229+
:::image-end:::
230230
231231
## Inline `friend` definitions
232232

‎docs/cpp/lvalues-and-rvalues-visual-cpp.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ description: "Learn more about: Lvalues and Rvalues (C++)"
33
title: "Value Categories: Lvalues and Rvalues (C++)"
44
ms.date: "05/07/2019"
55
helpviewer_keywords: ["R-values [C++]", "L-values [C++]"]
6-
ms.assetid: a8843344-cccc-40be-b701-b71f7b5cdcaf
76
---
87
# Lvalues and Rvalues (C++)
98

@@ -19,7 +18,10 @@ The C++17 standard defines expression value categories as follows:
1918

2019
The following diagram illustrates the relationships between the categories:
2120

22-
![C++ expression value categories.](media/value_categories.png "C++ expression value categories")
21+
:::image type="complex" source="media/value_categories.png" alt-text="C++ expression value categories.":::
22+
The diagram begins with a box labeled expression, which has two children: glvalue and rvalue. glvalue has two children: lvalue and xvalue. rvalue has two children: prvalue, and it shares xvalue which is also a child of glvalue.
23+
:::image-end:::
24+
2325

2426
An lvalue has an address that your program can access. Examples of lvalue expressions include variable names, including **`const`** variables, array elements, function calls that return an lvalue reference, bit-fields, unions, and class members.
2527

‎docs/cpp/member-access-control-cpp.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,9 @@ In the preceding example, calling the virtual function `GetState` using a pointe
230230

231231
In multiple-inheritance lattices involving virtual base classes, a given name can be reached through more than one path. Because different access control can be applied along these different paths, the compiler chooses the path that gives the most access. See the following figure.
232232

233-
![Diagram showing access along the paths of an inheritance graph.](../cpp/media/vc38v91.gif "Access along paths of an inheritance graph") <br/>
233+
:::image type="complex" source="../cpp/media/vc38v91.gif" alt-text="Diagram showing access along the paths of an inheritance graph.":::
234+
The diagram shows the following inheritance hierarchy: class VBase is the base class. Class LeftPath inherits from VBase using virtual private VBase. class RightPath also inherits from VBase but using virtual public VBase. Finally, class Derived inherits from both class LeftPath and class RightPath using public LeftPath, public RightPath.
235+
:::image-end:::
234236
Access along paths of an inheritance graph
235237

236238
In the figure, a name declared in class `VBase` is always reached through class `RightPath`. The right path is more accessible because `RightPath` declares `VBase` as a **`public`** base class, while `LeftPath` declares `VBase` as **`private`**.

‎docs/cpp/unions.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ description: "A description of the Standard C++ union class-type and keyword, it
44
ms.date: "08/18/2020"
55
f1_keywords: ["union_cpp"]
66
helpviewer_keywords: ["class type [C++], union as", "union keyword [C++]"]
7-
ms.assetid: 25c4e219-fcbb-4b7b-9b64-83f3252a92ca
87
no-loc: ["union", "struct", "enum", "class", "static"]
98
---
109
# `union`
@@ -536,8 +535,9 @@ int main()
536535

537536
The `NumericType` union is arranged in memory (conceptually) as shown in the following figure.
538537

539-
![Diagram that shows the overlapping storage of data in a numeric type union.](../cpp/media/vc38ul1.png "Storage of data in a NumericType union") <br/>
540-
Storage of data in a `NumericType` union
538+
:::image type="complex" source="../cpp/media/vc38ul1.png" alt-text="Diagram that shows the overlapping storage of data in the NumericType union.":::
539+
The diagram shows 8 bytes of data. The type double dValue occupies the entire 8 bytes. The type long lValue occupies the first four bytes. The type short iValue occupies the first byte.
540+
:::image-end:::
541541

542542
## <a name="anonymous_unions"></a> Anonymous union
543543

0 commit comments

Comments
 (0)