Some tests were constructing it with 0, so use -1 as the invalid state
instead.
Details
Diff Detail
Event Timeline
What's the general motivation for these changes?
What errors do you expect these asserts to find?
Honestly it's been so long since I sent this I've lost most of my context, but it was mostly motivated by bugs I found in SmallVector that, while not existent in libc++'s std::vector, weren't tested either.
What errors do you expect these asserts to find?
This helps cover cases where container resizing is performed in an order that invalidates the to-be-added elements before they're inserted into the sequence. I don't know of any bugs in std::vector for this case, but I've seen SmallVector bugs (which I haven't got around to fixing) that this would catch.
Somewhat related to http://reviews.llvm.org/D4088 (similar test coverage, but in D4095 the tests were already there, it's just that the move-only type wasn't verifying certain behavior so it could've silently passed with the same sort of bugs)
I can go back & try to reproduce the particular valid cases that are buggy in SmallVector and non-buggy but untested in std::vector, if you'd like.
I can go back & try to reproduce the particular valid cases that are buggy in SmallVector and non-buggy but untested in std::vector, if you'd like.
I would appreciate it; thanks.
And I apologize for taking so long on this that you forgot the context.