Commit 953369c3 authored by Bartek Nowierski's avatar Bartek Nowierski Committed by Commit Bot

Make VectorTraitsBase::IsDeletedValue accept a ref

This avoids passing an object by value (copy consturctor may not always exist).
No more need for overshadowing IsDeletedValue hack for VectorBackedLinkedListNode.

Change-Id: I5895a7e9b34f244e658bb319443b5c22451bd6ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2134750Reviewed-by: default avatarKeishi Hattori <keishi@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Commit-Queue: Kentaro Hara <haraken@chromium.org>
Auto-Submit: Bartek Nowierski <bartekn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#756174}
parent 468b6b18
......@@ -79,16 +79,6 @@ struct VectorTraits<VectorBackedLinkedListNode<ValueType, Allocator>>
VectorTraits<ValueType>::kCanCopyWithMemcpy;
static const bool kCanMoveWithMemcpy =
VectorTraits<ValueType>::kCanMoveWithMemcpy;
// Needs to be shadowing because |VectorTraitsBase::IsDeletedValue| uses call
// by value, which means we need to define copy constructor of
// |VectorBackedLinkedList|. We can remove this function if we change
// |VectorTraitsBase::IsDeletedValue| to use call by reference.
static bool IsDeletedValue(
const VectorBackedLinkedListNode<ValueType, Allocator>& node) {
NOTREACHED();
return false;
}
};
// VectorBackedLinkedList maintains a linked list through its contents such that
......
......@@ -66,7 +66,7 @@ struct VectorTraitsBase {
// Vectors do not support deleting values.
static constexpr bool kCanHaveDeletedValue = false;
static bool IsDeletedValue(T value) { return false; }
static bool IsDeletedValue(const T& value) { return false; }
};
template <typename T>
......
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