File tree Expand file tree Collapse file tree 2 files changed +2
-0
lines changed
Expand file tree Collapse file tree 2 files changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -430,6 +430,7 @@ for (vector<int>::iterator p=a.begin(); p!=a.end(); ++p)
430430vector<int> b(a.begin(), a.end()); // b is copy of a
431431vector<T> c(n, x); // c[0]..c[n-1] init to x
432432T d[10]; vector<T> e(d, d+10); // e is initialized from d
433+ a.clear(); // Erases all elements from the container. Leaves the capacity() of the vector unchanged.
433434```
434435
435436## ` deque ` (Array stack queue)
Original file line number Diff line number Diff line change @@ -402,6 +402,7 @@ for (vector<int>::iterator p=a.begin(); p!=a.end(); ++p)
402402vector<int > b (a.begin(), a.end()); // b is copy of a
403403vector<T> c (n, x); // c[0]..c[n-1] init to x
404404T d[10 ]; vector<T> e (d, d+10 ); // e is initialized from d
405+ a.clear(); // Erases all elements from the container. Leaves the capacity() of the vector unchanged.
405406
406407// ## `deque` (Array stack queue)
407408
You can’t perform that action at this time.
0 commit comments