From acfd33824aacbb6d0467fdbc2bd4900582966933 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Fri, 31 Mar 2023 15:00:26 -0700 Subject: 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 --- absl/container/inlined_vector.h | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/absl/container/inlined_vector.h b/absl/container/inlined_vector.h index 6268eebf..5674ce99 100644 --- a/absl/container/inlined_vector.h +++ b/absl/container/inlined_vector.h @@ -189,18 +189,8 @@ class InlinedVector { // 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 && std::is_same>::value && - absl::is_trivially_copy_assignable::value && - absl::is_trivially_destructible::value && !other.storage_.GetIsAllocated()) { storage_.MemcpyFrom(other.storage_); return; -- cgit v1.2.3