Commit 156b10f5 by Aaron Jacobs Committed by Copybara-Service

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
parent 2e47068d
...@@ -326,12 +326,8 @@ class Storage { ...@@ -326,12 +326,8 @@ class Storage {
// then it's safe for us to simply swap the bytes in the inline 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 // 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. // one to the other, then move-assigned the first from the temporary.
// absl::conjunction<absl::is_trivially_move_constructible<ValueType<A>>,
// TODO(b/274984172): we check for copy-constructability and absl::is_trivially_move_assignable<ValueType<A>>,
// -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::is_trivially_destructible<ValueType<A>>, absl::is_trivially_destructible<ValueType<A>>,
std::is_same<A, std::allocator<ValueType<A>>>>::value, std::is_same<A, std::allocator<ValueType<A>>>>::value,
MemcpyPolicy, MemcpyPolicy,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment