diff options
author | Aaron Jacobs <jacobsa@google.com> | 2023-04-11 19:14:45 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-04-11 19:15:46 -0700 |
commit | 156b10f550950cecdd484f9bfcec30bec73ea406 (patch) | |
tree | 3de73951d107b3197f73da7d73836afb0752babc | |
parent | 2e47068db220fc9897ce8140e4dae5c11bb09f2c (diff) |
inlined_vector: fix incorrect restrictions on the swap fast path.
This has nothing to do with copy construction or copy assignment.
PiperOrigin-RevId: 523571907
Change-Id: I338b5a40616594406ca8c80b747540c8935798e9
-rw-r--r-- | absl/container/internal/inlined_vector.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/absl/container/internal/inlined_vector.h b/absl/container/internal/inlined_vector.h index 945129b9..e1404955 100644 --- a/absl/container/internal/inlined_vector.h +++ b/absl/container/internal/inlined_vector.h @@ -326,12 +326,8 @@ class Storage { // then it's safe for us to simply swap the bytes in the inline storage. // It's as if we had move-constructed a temporary vector, move-assigned // one to the other, then move-assigned the first from the temporary. - // - // TODO(b/274984172): we check for copy-constructability and - // -assignability here only for historical reasons. This is too strict: we - // are simulating move operations here. - absl::conjunction<absl::is_trivially_copy_constructible<ValueType<A>>, - absl::is_trivially_copy_assignable<ValueType<A>>, + absl::conjunction<absl::is_trivially_move_constructible<ValueType<A>>, + absl::is_trivially_move_assignable<ValueType<A>>, absl::is_trivially_destructible<ValueType<A>>, std::is_same<A, std::allocator<ValueType<A>>>>::value, MemcpyPolicy, |