[SmallVector] Weaken the predicate for the memcpy optimization
We don't require the type to be trivially assignable. While the standard says that only is_trivially_copyable types may be memcpy'd, this seems overly strict. We never assign the type, so there's no way for the type to observe that the copy/move construction got elided. This is important for std::pair<POD, POD>, which is not trivially assignable and probably never will be because changing that would break ABI. As a side-effect this no longer allows types with deleted copy/move constructors in SmallVector. That's an unintended side-effect of is_trivially_copyable anyways. Shrinks Release+Asserts clang by 20k.
Loading
Please sign in to comment