svector
svector copied to clipboard
v.push_back(v[0]) doesn't work, can lead to segmentation fault on resizing
Describe the bug
or v.assign(1000, v[0]). This should work, it does so per the standard for std::vector, even when it needs to resize.
See https://stackoverflow.com/a/18788810/48181