Update c++.html.markdown

v.empty() queries if v is empty while v.clear() actually clears it (or rather sets size to 0).
This commit is contained in:
AndrejPetelin 2016-01-31 16:08:28 +01:00
parent e1016455d5
commit 1bb2535efd

View File

@ -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