summaryrefslogtreecommitdiff
path: root/absl/container/inlined_vector.h
diff options
context:
space:
mode:
authorGravatar Aaron Jacobs <jacobsa@google.com>2023-03-31 15:00:26 -0700
committerGravatar Copybara-Service <copybara-worker@google.com>2023-03-31 15:01:17 -0700
commitacfd33824aacbb6d0467fdbc2bd4900582966933 (patch)
tree62ddb7475b3ac857c1e617597e922b5c87c58be9 /absl/container/inlined_vector.h
parent6a37c26abf83dedfc2476eb2d6d597a1f88d40d0 (diff)
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
Diffstat (limited to 'absl/container/inlined_vector.h')
-rw-r--r--absl/container/inlined_vector.h10
1 files changed, 0 insertions, 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_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;