inlined_vector: remove excess restrictions on copy constructor fast path.
The copy constructor isn't doing or simulating copy assignment; nor is it
destroying anything. We don't need to require that those operations be trivial.
PiperOrigin-RevId: 521020499
Change-Id: I0f36a720384b333ea15e6c8275872fd4fd9a738f
diff --git a/absl/container/inlined_vector.h b/absl/container/inlined_vector.h
index 6268eeb..5674ce9 100644
--- a/absl/container/inlined_vector.h
+++ b/absl/container/inlined_vector.h
@@ -189,18 +189,8 @@
// allocator doesn't do anything fancy, and there is nothing on the heap
// then we know it is legal for us to simply memcpy the other vector's
// inlined bytes to form our copy of its elements.
- //
- // TODO(b/274984172): the condition on copy-assignability is here only for
- // historical reasons. It doesn't make semantic sense: we don't need to be
- // able to copy assign here, we are doing an "as-if" copy construction.
- //
- // TODO(b/274984172): the condition on trivial destructibility is here only
- // for historical reasons. It doesn't make sense: there is no destruction
- // here.
if (absl::is_trivially_copy_constructible<value_type>::value &&
std::is_same<A, std::allocator<value_type>>::value &&
- absl::is_trivially_copy_assignable<value_type>::value &&
- absl::is_trivially_destructible<value_type>::value &&
!other.storage_.GetIsAllocated()) {
storage_.MemcpyFrom(other.storage_);
return;