Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This header is C++20-only, because it relies on `[[no_unique_address]]` to store the allocator without trickery, and it relies on `requires` to make the special members conditionally trivial. The entire `inplace_vector` test suite is included as a subset of the `aa_inplace_vector` test suite, showing that the AA version is indeed a drop-in replacement for the non-AA version. AA `inplace_vector` has an important precondition: `operator=`, as well as `swap`, has the precondition that if the allocator propagates horizontally, then the two vectors' allocators must compare equal. (Otherwise, following an assignment `OLD = NEW`, we'd end up destroying with allocator `NEW` some elements that had originally been constructed with allocator `OLD`.) We introduce a new macro `SG14_INPLACE_VECTOR_ASSERT_PRECONDITION` for this purpose.
- Loading branch information