Skip to content

Commit ec273a0

Browse files
authored
Merge pull request #1843 from mikeblome/mb-debug-iterators
reverted code example to original version
2 parents 3532ee1 + 59ed4f6 commit ec273a0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

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

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,12 @@ struct derived : base {
151151
~derived() {}
152152
};
153153

154-
int main() {
155-
auto vect = std::vector<int>(10);
156-
auto sink = new auto(std::begin(vect));
157-
::operator delete(sink); // frees the memory without calling ~iterator()
158-
} // access violation
154+
int main() {
155+
std::vector<int> vect( 10 );
156+
base * pb = new derived( vect.begin() );
157+
delete pb; // doesn't call ~derived()
158+
// access violation
159+
}
159160
```
160161
161162
## See also

0 commit comments

Comments
 (0)