Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1504)

Unified Diff: Source/wtf/ListHashSet.h

Issue 223373002: Create HeapLinkedHashSet and LinkedHashSet, ordered heap-friendly hash sets. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix gtest-related compile error on gcc by removing internal typedefs in iterators Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/wtf/LinkedHashSet.h ('k') | Source/wtf/ListHashSetTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/ListHashSet.h
diff --git a/Source/wtf/ListHashSet.h b/Source/wtf/ListHashSet.h
index dd1893c7d7df6137cf5d6d0b864ac4c34756965e..6f01beae74d0fe0a97c7c029df8723f41e914791 100644
--- a/Source/wtf/ListHashSet.h
+++ b/Source/wtf/ListHashSet.h
@@ -300,7 +300,6 @@ namespace WTF {
template<typename ValueArg, size_t inlineCapacity, typename HashArg> class ListHashSetIterator {
private:
typedef ListHashSet<ValueArg, inlineCapacity, HashArg> ListHashSetType;
- typedef ListHashSetIterator<ValueArg, inlineCapacity, HashArg> iterator;
typedef ListHashSetConstIterator<ValueArg, inlineCapacity, HashArg> const_iterator;
typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
typedef ValueArg ValueType;
@@ -320,17 +319,17 @@ namespace WTF {
ReferenceType operator*() const { return *get(); }
PointerType operator->() const { return get(); }
- iterator& operator++() { ++m_iterator; return *this; }
+ ListHashSetIterator& operator++() { ++m_iterator; return *this; }
// postfix ++ intentionally omitted
- iterator& operator--() { --m_iterator; return *this; }
+ ListHashSetIterator& operator--() { --m_iterator; return *this; }
// postfix -- intentionally omitted
// Comparison.
- bool operator==(const iterator& other) const { return m_iterator == other.m_iterator; }
- bool operator!=(const iterator& other) const { return m_iterator != other.m_iterator; }
+ bool operator==(const ListHashSetIterator& other) const { return m_iterator == other.m_iterator; }
+ bool operator!=(const ListHashSetIterator& other) const { return m_iterator != other.m_iterator; }
operator const_iterator() const { return m_iterator; }
@@ -343,7 +342,6 @@ namespace WTF {
template<typename ValueArg, size_t inlineCapacity, typename HashArg> class ListHashSetConstIterator {
private:
typedef ListHashSet<ValueArg, inlineCapacity, HashArg> ListHashSetType;
- typedef ListHashSetIterator<ValueArg, inlineCapacity, HashArg> iterator;
typedef ListHashSetConstIterator<ValueArg, inlineCapacity, HashArg> const_iterator;
typedef ListHashSetNode<ValueArg, inlineCapacity> Node;
typedef ValueArg ValueType;
@@ -946,6 +944,7 @@ namespace WTF {
{
return ListHashSetConstIterator<T, inlineCapacity, U>(this, position);
}
+
template<bool, typename ValueType, typename HashTableType>
void deleteAllValues(HashTableType& collection)
{
@@ -955,6 +954,9 @@ namespace WTF {
delete (*it)->m_value;
}
+ // Warning: After and while calling this you have a collection with deleted
+ // pointers. Consider using a smart pointer like OwnPtr and calling clear()
+ // instead.
template<typename T, size_t inlineCapacity, typename U>
inline void deleteAllValues(const ListHashSet<T, inlineCapacity, U>& collection)
{
« no previous file with comments | « Source/wtf/LinkedHashSet.h ('k') | Source/wtf/ListHashSetTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698