Commit 566bc52
committed
[libc++][vector<bool>] Tests shrink_to_fit requirement.
vector<bool>'s shrink_to_fit implementation is using the
"swap-to-free-container-resources-trick" which only shrinks when the input
vector is empty. Since the request to shrink_to_fit is non-binding, this
is a valid implementation. It is not a high-quality implementation. Since
vector<bool> is not a very popular container the implementation has not
been changed and only a test to validate the non-growing property has been
added.
This was discovered while investigating #951611 parent 857700f commit 566bc52
File tree
1 file changed
+37
-0
lines changed- libcxx/test/std/containers/sequences/vector.bool
1 file changed
+37
-0
lines changedLines changed: 37 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
42 | 78 | | |
43 | 79 | | |
44 | 80 | | |
| 81 | + | |
45 | 82 | | |
46 | 83 | | |
47 | 84 | | |
| |||
0 commit comments