Skip to content

Commit e974c8e

Browse files
authored
Merge pull request #4095 from MicrosoftDocs/main637961820379113059sync_temp
Repo sync for protected CLA branch
2 parents 3ae3d40 + 2f79361 commit e974c8e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

docs/standard-library/debug-iterator-support.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ description: "Learn more about: Debug Iterator Support"
33
title: "Debug Iterator Support"
44
ms.date: "09/13/2018"
55
helpviewer_keywords: ["Safe Libraries", "Safe Libraries, C++ Standard Library", "Safe C++ Standard Library", "C++ Standard Library, debug iterator support", "iterators, debug iterator support", "iterators, incompatible", "incompatible iterators", "debug iterator support"]
6-
ms.assetid: f3f5bd15-4be8-4d64-a4d0-8bc0761c68b6
76
---
87
# Debug Iterator Support
98

@@ -43,7 +42,7 @@ int main() {
4342

4443
## Using _ITERATOR_DEBUG_LEVEL
4544

46-
You can use the preprocessor macro [_ITERATOR_DEBUG_LEVEL](../standard-library/iterator-debug-level.md) to turn off the iterator debugging feature in a debug build. This program does not assert, but still triggers undefined behavior.
45+
You can use the preprocessor macro [_ITERATOR_DEBUG_LEVEL](../standard-library/iterator-debug-level.md) to turn off the iterator debugging feature in a debug build. This program doesn't assert, but still triggers undefined behavior.
4746

4847
```cpp
4948
// iterator_debugging_1.cpp
@@ -74,9 +73,9 @@ int main() {
7473
-572662307
7574
```
7675

77-
## Unitialized iterators
76+
## Uninitialized iterators
7877

79-
An assert also occurs if you attempt to use an iterator before it is initialized, as shown here:
78+
An assert also occurs if you attempt to use an iterator before it's initialized, as shown here:
8079

8180
```cpp
8281
// iterator_debugging_2.cpp
@@ -113,7 +112,7 @@ int main()
113112
}
114113
```
115114

116-
Notice that this example uses the lambda expression `[] (int& elem) { elem *= 2; }` instead of a functor. Although this choice has no bearing on the assert failure—a similar functor would cause the same failure—lambdas are a very useful way to accomplish compact function object tasks. For more information about lambda expressions, see [Lambda Expressions](../cpp/lambda-expressions-in-cpp.md).
115+
Notice that this example uses the lambda expression `[] (int& elem) { elem *= 2; }` instead of a functor. Although this choice has no bearing on the assert failure—a similar functor would cause the same failure—lambdas are a way to write a short block of code. For more information about lambda expressions, see [Lambda expressions](../cpp/lambda-expressions-in-cpp.md).
117116

118117
## Iterators going out of scope
119118

@@ -135,7 +134,7 @@ int main() {
135134

136135
## Destructors for debug iterators
137136

138-
Debug iterators have non-trivial destructors. If a destructor does not run but the object's memory is freed, access violations and data corruption might occur. Consider this example:
137+
Debug iterators have non-trivial destructors. If a destructor doesn't run but the object's memory is freed, access violations and data corruption might occur. Consider this example:
139138

140139
```cpp
141140
// iterator_debugging_5.cpp

0 commit comments

Comments
 (0)