diff options
author | AndrejPetelin <petelin.andrej@siol.com> | 2016-01-31 16:08:28 +0100 |
---|---|---|
committer | AndrejPetelin <petelin.andrej@siol.com> | 2016-01-31 16:08:28 +0100 |
commit | 1bb2535efda67de687d4eb94a0f964f9c06dcd4a (patch) | |
tree | 8658f618d0b7b836c141562fb43f339fb80aa830 /c++.html.markdown | |
parent | e1016455d5e4472e7a533c8cdd6df8ae4f2e7854 (diff) |
Update c++.html.markdown
v.empty() queries if v is empty while v.clear() actually clears it (or rather sets size to 0).
Diffstat (limited to 'c++.html.markdown')
-rw-r--r-- | c++.html.markdown | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/c++.html.markdown b/c++.html.markdown index 82662b15..a59b4db8 100644 --- a/c++.html.markdown +++ b/c++.html.markdown @@ -948,7 +948,7 @@ for (int i = 0; i < 10; ++i) // Following line sets size of v to 0, but destructors don't get called // and resources aren't released! -v.empty(); +v.clear(); v.push_back(Foo()); // New value is copied into the first Foo we inserted // Truly destroys all values in v. See section about temporary objects for |