Skip to content

Commit 71f938f

Browse files
TylerMSFTTylerMSFT
authored andcommitted
updating atl-text
1 parent 5ea6002 commit 71f938f

14 files changed

Lines changed: 82 additions & 72 deletions

docs/build/reference/common-macros-for-build-commands-and-properties.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Depending on your installation options, Visual Studio can make hundreds of macro
1010

1111
## View the current properties and macros
1212

13-
To display all of the currently available macros, open the project property pages from the main menu by selecting **Project** > **Properties**. In the **Property Pages** dialog, choose an entry that has a macro in it. You can recognize a a macro by the dollar sign and parenthesis that surround its name. For example, select **Configuration Properties** > **VC++ Directories** in the left pane, and then select **Include directories** in the right pane. The value for **Include directories** is `$(VC_IncludePath);$(WindowsSDK_IncludePath);`, which indicates that the include directories are populated by the expansion of those two macros. Select the drop-down arrow at the end of that row (you'll need to click the row to see it), then select **Edit**. In the **Include Directories** dialog box that appears, select the **Macros>>** button. That expands the dialog to show the current set of properties and macros visible to Visual Studio, along with the current value for each. For more information, see the **Specifying User-Defined Values** section of [C++ project property page reference](property-pages-visual-cpp.md).
13+
To display all of the currently available macros, open the project property pages from the main menu by selecting **Project** > **Properties**. In the **Property Pages** dialog, choose an entry that has a macro in it. You can recognize a macro by the dollar sign and parenthesis that surround its name. For example, select **Configuration Properties** > **VC++ Directories** in the left pane, and then select **Include directories** in the right pane. The value for **Include directories** is `$(VC_IncludePath);$(WindowsSDK_IncludePath);`, which indicates that the include directories are populated by the expansion of those two macros. Select the drop-down arrow at the end of that row (you'll need to click the row to see it), then select **Edit**. In the **Include Directories** dialog box that appears, select the **Macros>>** button. That expands the dialog to show the current set of properties and macros visible to Visual Studio, along with the current value for each. For more information, see the **Specifying User-Defined Values** section of [C++ project property page reference](property-pages-visual-cpp.md).
1414

1515
:::image type="complex" source="../media/vcppdir_libdir_macros.png" alt-text="Screenshot of the Visual Studio Include Directories dialog after choosing the Macros button.":::
16-
Screenshot of the Visual Studio **Include Directories** dialog. On the right are a list of Visual Studio macros. On the left is a pane that shows the evaluated value of the include directory property. The bottom pane shows which macros were expanded, if any, as part of the evaluation. Because the Include Directories macro is a combination of two other macros, $(VC_IncludePath) and $(WindowsSDK_IncludePath), the bottom pane, labeled Inherited values, lists those two macros.
16+
Screenshot of the Visual Studio **Include Directories** dialog. On the right is a list of Visual Studio macros. On the left is a pane that shows the evaluated value of the include directory property. The bottom pane shows which macros were expanded, if any, as part of the evaluation. Because the Include Directories macro is a combination of two other macros, $(VC_IncludePath) and $(WindowsSDK_IncludePath), the bottom pane, labeled Inherited values, lists those two macros.
1717
:::image-end:::
1818

1919
## List of common macros
@@ -57,7 +57,7 @@ This table describes a commonly used subset of the available macros; there are m
5757

5858
## Obsolete macros
5959

60-
The build system for C++ was changed significantly between Visual Studio 2008 and Visual Studio 2010. Many macros used in earlier project types have been changed to new ones. These macros are no longer used or have been replaced by one or more equivalent properties or [item metadata macro](/visualstudio/msbuild/itemmetadata-element-msbuild) (**`%(item-name)`**) values. Macros that are marked "migrated" can be updated by the project migration tool. If the project that contains the macro is migrated from Visual Studio 2008 or earlier to Visual Studio 2010, Visual Studio converts the macro to the equivalent current macro. Later versions of Visual Studio can't convert projects from Visual Studio 2008 and earlier to the new project type. You must convert these projects in two steps; first convert them to Visual Studio 2010, and then convert the result to your newer version of Visual Studio. For more information, see [Overview of potential upgrade issues](../../porting/overview-of-potential-upgrade-issues-visual-cpp.md).
60+
The build system for C++ was changed significantly between Visual Studio 2008 and Visual Studio 2010. Many macros used in earlier project types have been changed to new ones. These macros are no longer used or have been replaced by one or more equivalent properties or [item metadata macro](/visualstudio/msbuild/itemmetadata-element-msbuild) (**`%(item-name)`**) values. Macros marked "migrated" can be updated by the project migration tool. If the project that contains the macro is migrated from Visual Studio 2008 or earlier to Visual Studio 2010, Visual Studio converts the macro to the equivalent current macro. Later versions of Visual Studio can't convert projects from Visual Studio 2008 and earlier to the new project type. You must convert these projects in two steps; first convert them to Visual Studio 2010, and then convert the result to your newer version of Visual Studio. For more information, see [Overview of potential upgrade issues](../../porting/overview-of-potential-upgrade-issues-visual-cpp.md).
6161

6262
| Macro | Description |
6363
|--|--|

docs/cpp/arrays-cpp.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ title: "Arrays (C++)"
33
description: "Learn how to declare and use the native array type in the standard C++ programming language."
44
ms.date: 11/08/2020
55
helpviewer_keywords: ["declaring arrays [C++], about declaring arrays", "multidimensional arrays [C++]", "arrays [C++]"]
6-
ms.assetid: 3f5986aa-485c-4ba4-9502-67e2ef924238
76
---
87
# Arrays (C++)
98

10-
An array is a sequence of objects of the same type that occupy a contiguous area of memory. Traditional C-style arrays are the source of many bugs, but are still common, especially in older code bases. In modern C++, we strongly recommend using [std::vector](../standard-library/vector-class.md) or [std::array](../standard-library/array-class-stl.md) instead of C-style arrays described in this section. Both of these standard library types store their elements as a contiguous block of memory. However, they provide much greater type safety, and support iterators that are guaranteed to point to a valid location within the sequence. For more information, see [Containers](../standard-library/stl-containers.md).
9+
An array is a sequence of objects of the same type that occupy a contiguous area of memory. Traditional C-style arrays are the source of many bugs, but are still common, especially in older code bases. In modern C++, we strongly recommend using [`std::vector`](../standard-library/vector-class.md) or [`std::array`](../standard-library/array-class-stl.md) instead of C-style arrays described in this section. Both of these standard library types store their elements as a contiguous block of memory. However, they provide much greater type safety, and support iterators that are guaranteed to point to a valid location within the sequence. For more information, see [Containers](../standard-library/stl-containers.md).
1110

1211
## Stack declarations
1312

@@ -162,8 +161,9 @@ int i2[5][7];
162161

163162
It specifies an array of type **`int`**, conceptually arranged in a two-dimensional matrix of five rows and seven columns, as shown in the following figure:
164163

165-
![Conceptual layout of a multi dimensional array.](../cpp/media/vc38rc1.gif) <br/>
166-
Conceptual layout of a multi-dimensional array
164+
:::image type="content" source="../cpp/media/vc38rc1.gif" alt-text="Conceptual layout of a multi dimensional array.":::
165+
The image is a grid 7 cells wide and 5 cells high. Each cell contains the index of the cell. The first cell index is 0,0. The next cell in that row is 0,1 and so on to the last cell in that row which is 0,6. The next row starts with the index 1,0. The cell after that has an index of 1,1. The last cell in that row is 1,6. This pattern repeats until the last row which starts with the index 4,0 and the last cell has the index 4,6.
166+
:::image-end
167167

168168
You can declare multidimensioned arrays that have an initializer list (as described in [Initializers](../cpp/initializers.md)). In these declarations, the constant expression that specifies the bounds for the first dimension can be omitted. For example:
169169

@@ -357,4 +357,4 @@ szError1 = psz;
357357

358358
## See also
359359

360-
[std::array](../standard-library/array-class-stl.md)
360+
[`std::array`](../standard-library/array-class-stl.md)

docs/cpp/destructors-cpp.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ helpviewer_keywords: ["objects [C++], destroying", "destructors, C++"]
88

99
A destructor is a member function that is invoked automatically when the object goes out of scope or is explicitly destroyed by a call to **`delete`**. A destructor has the same name as the class, preceded by a tilde (`~`). For example, the destructor for class `String` is declared: `~String()`.
1010

11-
If you do not define a destructor, the compiler will provide a default one; for many classes this is sufficient. You only need to define a custom destructor when the class stores handles to system resources that need to be released, or pointers that own the memory they point to.
11+
If you don't define a destructor, the compiler will provide a default one; for many classes this is sufficient. You only need to define a custom destructor when the class stores handles to system resources that need to be released, or pointers that own the memory they point to.
1212

1313
Consider the following declaration of a `String` class:
1414

@@ -57,13 +57,13 @@ Destructors are functions with the same name as the class but preceded by a tild
5757
5858
Several rules govern the declaration of destructors. Destructors:
5959
60-
- Do not accept arguments.
60+
- Don't accept arguments.
6161
62-
- Do not return a value (or **`void`**).
62+
- Don't return a value (or **`void`**).
6363
64-
- Cannot be declared as **`const`**, **`volatile`**, or **`static`**. However, they can be invoked for the destruction of objects declared as **`const`**, **`volatile`**, or **`static`**.
64+
- Can't be declared as **`const`**, **`volatile`**, or **`static`**. However, they can be invoked for the destruction of objects declared as **`const`**, **`volatile`**, or **`static`**.
6565
66-
- Can be declared as **`virtual`**. Using virtual destructors, you can destroy objects without knowing their typethe correct destructor for the object is invoked using the virtual function mechanism. Note that destructors can also be declared as pure virtual functions for abstract classes.
66+
- Can be declared as **`virtual`**. Using virtual destructors, you can destroy objects without knowing their typethe correct destructor for the object is invoked using the virtual function mechanism. Destructors can also be declared as pure virtual functions for abstract classes.
6767
6868
## Using destructors
6969
@@ -83,9 +83,9 @@ Destructors can freely call class member functions and access class member data.
8383
8484
There are two restrictions on the use of destructors:
8585
86-
- You cannot take its address.
86+
- You can't take its address.
8787
88-
- Derived classes do not inherit the destructor of their base class.
88+
- Derived classes don't inherit the destructor of their base class.
8989
9090
## Order of destruction
9191
@@ -140,7 +140,7 @@ B1 dtor
140140
Destructors for virtual base classes are called in the reverse order of their appearance in a directed acyclic graph (depth-first, left-to-right, postorder traversal). the following figure depicts an inheritance graph.
141141

142142
:::image type="complex" source="../cpp/media/vc392j1.gif" alt-text="Inheritance graph that shows virtual base classes.":::
143-
There are 5 classes, labeled A through E, arranged in an inheritance graph. Class E is the base class of classes B, C, and D. Classes C and D are the base class of classes A and B.
143+
There are five classes, labeled A through E, arranged in an inheritance graph. Class E is the base class of classes B, C, and D. Classes C and D are the base class of classes A and B.
144144
:::image-end:::
145145

146146
The following lists the class heads for the classes shown in the figure.
@@ -161,9 +161,9 @@ To determine the order of destruction of the virtual base classes of an object o
161161
162162
1. Revisit the previous node (down and to the right) to find out whether the node being remembered is a virtual base class.
163163
164-
1. If the remembered node is a virtual base class, scan the list to see whether it has already been entered. If it is not a virtual base class, ignore it.
164+
1. If the remembered node is a virtual base class, scan the list to see whether it has already been entered. If it isn't a virtual base class, ignore it.
165165
166-
1. If the remembered node is not yet in the list, add it to the bottom of the list.
166+
1. If the remembered node isn't yet in the list, add it to the bottom of the list.
167167
168168
1. Traverse the graph up and along the next path to the right.
169169
@@ -187,9 +187,9 @@ Therefore, for class `E`, the order of destruction is:
187187
188188
1. The virtual base class `A`.
189189
190-
This process produces an ordered list of unique entries. No class name appears twice. Once the list is constructed, it is walked in reverse order, and the destructor for each of the classes in the list from the last to the first is called.
190+
This process produces an ordered list of unique entries. No class name appears twice. Once the list is constructed, it's walked in reverse order, and the destructor for each of the classes in the list from the last to the first is called.
191191
192-
The order of construction or destruction is primarily important when constructors or destructors in one class rely on the other component being created first or persisting longerfor example, if the destructor for `A` (in the figure shown above) relied on `B` still being present when its code executed, or vice versa.
192+
The order of construction or destruction is primarily important when constructors or destructors in one class rely on the other component being created first or persisting longerfor example, if the destructor for `A` (in the figure shown above) relied on `B` still being present when its code executed, or vice versa.
193193
194194
Such interdependencies between classes in an inheritance graph are inherently dangerous because classes derived later can alter which is the leftmost path, thereby changing the order of construction and destruction.
195195
@@ -206,7 +206,7 @@ In the preceding example, the destructor for `Base2` is called before the destru
206206

207207
## Explicit destructor calls
208208

209-
Calling a destructor explicitly is seldom necessary. However, it can be useful to perform cleanup of objects placed at absolute addresses. These objects are commonly allocated using a user-defined **`new`** operator that takes a placement argument. The **`delete`** operator cannot deallocate this memory because it is not allocated from the free store (for more information, see [The new and delete Operators](../cpp/new-and-delete-operators.md)). A call to the destructor, however, can perform appropriate cleanup. To explicitly call the destructor for an object, `s`, of class `String`, use one of the following statements:
209+
Calling a destructor explicitly is seldom necessary. However, it can be useful to perform cleanup of objects placed at absolute addresses. These objects are commonly allocated using a user-defined **`new`** operator that takes a placement argument. The **`delete`** operator can't deallocate this memory because it isn't allocated from the free store (for more information, see [The new and delete Operators](../cpp/new-and-delete-operators.md)). A call to the destructor, however, can perform appropriate cleanup. To explicitly call the destructor for an object, `s`, of class `String`, use one of the following statements:
210210

211211
```cpp
212212
s.String::~String(); // non-virtual call
@@ -222,7 +222,7 @@ The notation for explicit calls to destructors, shown in the preceding, can be u
222222

223223
A class needs a destructor if it acquires a resource, and to manage the resource safely it probably has to implement a copy constructor and a copy assignment.
224224

225-
If these special functions are not defined by the user, they are implicitly defined by the compiler. The implicitly generated constructors and assignment operators perform shallow, memberwise copy, which is almost certainly wrong if an object is managing a resource.
225+
If these special functions aren't defined by the user, they're implicitly defined by the compiler. The implicitly generated constructors and assignment operators perform shallow, memberwise copy, which is almost certainly wrong if an object is managing a resource.
226226

227227
In the next example, the implicitly generated copy constructor will make the pointers `str1.text` and `str2.text` refer to the same memory, and when we return from `copy_strings()`, that memory will be deleted twice, which is undefined behavior:
228228

0 commit comments

Comments
 (0)