| Index: third_party/WebKit/Source/wtf/HashSet.h
|
| diff --git a/third_party/WebKit/Source/wtf/HashSet.h b/third_party/WebKit/Source/wtf/HashSet.h
|
| index afd943b3f2936dd10fa69eb8ace109c58fb32f30..4f36cf224797de40319a0b813f11f24c979eeffb 100644
|
| --- a/third_party/WebKit/Source/wtf/HashSet.h
|
| +++ b/third_party/WebKit/Source/wtf/HashSet.h
|
| @@ -23,6 +23,7 @@
|
|
|
| #include "wtf/HashTable.h"
|
| #include "wtf/allocator/PartitionAllocator.h"
|
| +#include <initializer_list>
|
|
|
| namespace WTF {
|
|
|
| @@ -55,6 +56,15 @@ public:
|
| typedef HashTableConstIteratorAdapter<HashTableType, ValueTraits> const_iterator;
|
| typedef typename HashTableType::AddResult AddResult;
|
|
|
| + HashSet() = default;
|
| + HashSet(const HashSet&) = default;
|
| + HashSet& operator=(const HashSet&) = default;
|
| + HashSet(HashSet&&) = default;
|
| + HashSet& operator=(HashSet&&) = default;
|
| +
|
| + HashSet(std::initializer_list<ValueType> elements);
|
| + HashSet& operator=(std::initializer_list<ValueType> elements);
|
| +
|
| void swap(HashSet& ref)
|
| {
|
| m_impl.swap(ref.m_impl);
|
| @@ -131,6 +141,22 @@ struct HashSetTranslatorAdapter {
|
| }
|
| };
|
|
|
| +template <typename Value, typename HashFunctions, typename Traits, typename Allocator>
|
| +HashSet<Value, HashFunctions, Traits, Allocator>::HashSet(std::initializer_list<ValueType> elements)
|
| +{
|
| + if (elements.size())
|
| + m_impl.reserveCapacityForSize(elements.size());
|
| + for (const ValueType& element : elements)
|
| + add(element);
|
| +}
|
| +
|
| +template <typename Value, typename HashFunctions, typename Traits, typename Allocator>
|
| +auto HashSet<Value, HashFunctions, Traits, Allocator>::operator=(std::initializer_list<ValueType> elements) -> HashSet&
|
| +{
|
| + *this = HashSet(std::move(elements));
|
| + return *this;
|
| +}
|
| +
|
| template <typename T, typename U, typename V, typename W>
|
| inline unsigned HashSet<T, U, V, W>::size() const
|
| {
|
|
|