From 24fd67c58f7df76df570f5f7f3e28c007381da7d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 19 Jul 2009 16:34:50 +0200 Subject: Work around an apparent xlC 7 bug: partial specialisation on HashMap. This problem was appearing only in the functions in the HashMap partial specialisation for Ref that returned std::pair. "/pulse/qt/src/3rdparty/webkit/JavaScriptCore/wtf/RefPtrHashMap.h", line 205.5: 1540-1174 (S) The member "template std::pair,U,V,W,X>::iterator,bool> inlineAdd(const KeyType &, const MappedType &)" is not declared as a template in its containing class definition. --- .../webkit/JavaScriptCore/wtf/RefPtrHashMap.h | 103 +++++++++++---------- 1 file changed, 54 insertions(+), 49 deletions(-) diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/RefPtrHashMap.h b/src/3rdparty/webkit/JavaScriptCore/wtf/RefPtrHashMap.h index 08f1619..b3ccd3a 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/RefPtrHashMap.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/RefPtrHashMap.h @@ -42,7 +42,7 @@ namespace WTF { }; template - class HashMap, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg> { + class RefPtrHashMap { private: typedef KeyTraitsArg KeyTraits; typedef MappedTraitsArg MappedTraits; @@ -67,7 +67,7 @@ namespace WTF { typedef HashTableIteratorAdapter iterator; typedef HashTableConstIteratorAdapter const_iterator; - void swap(HashMap&); + void swap(RefPtrHashMap&); int size() const; int capacity() const; @@ -115,118 +115,123 @@ namespace WTF { HashTableType m_impl; }; + template + class HashMap, MappedArg, HashArg, KeyTraitsArg, MappedTraitsArg> : + public RefPtrHashMap + { + }; template - inline void HashMap, U, V, W, X>::swap(HashMap& other) + inline void RefPtrHashMap::swap(RefPtrHashMap& other) { m_impl.swap(other.m_impl); } template - inline int HashMap, U, V, W, X>::size() const + inline int RefPtrHashMap::size() const { return m_impl.size(); } template - inline int HashMap, U, V, W, X>::capacity() const + inline int RefPtrHashMap::capacity() const { return m_impl.capacity(); } template - inline bool HashMap, U, V, W, X>::isEmpty() const + inline bool RefPtrHashMap::isEmpty() const { return m_impl.isEmpty(); } template - inline typename HashMap, U, V, W, X>::iterator HashMap, U, V, W, X>::begin() + inline typename RefPtrHashMap::iterator RefPtrHashMap::begin() { return m_impl.begin(); } template - inline typename HashMap, U, V, W, X>::iterator HashMap, U, V, W, X>::end() + inline typename RefPtrHashMap::iterator RefPtrHashMap::end() { return m_impl.end(); } template - inline typename HashMap, U, V, W, X>::const_iterator HashMap, U, V, W, X>::begin() const + inline typename RefPtrHashMap::const_iterator RefPtrHashMap::begin() const { return m_impl.begin(); } template - inline typename HashMap, U, V, W, X>::const_iterator HashMap, U, V, W, X>::end() const + inline typename RefPtrHashMap::const_iterator RefPtrHashMap::end() const { return m_impl.end(); } template - inline typename HashMap, U, V, W, X>::iterator HashMap, U, V, W, X>::find(const KeyType& key) + inline typename RefPtrHashMap::iterator RefPtrHashMap::find(const KeyType& key) { return m_impl.find(key); } template - inline typename HashMap, U, V, W, X>::iterator HashMap, U, V, W, X>::find(RawKeyType key) + inline typename RefPtrHashMap::iterator RefPtrHashMap::find(RawKeyType key) { return m_impl.template find(key); } template - inline typename HashMap, U, V, W, X>::const_iterator HashMap, U, V, W, X>::find(const KeyType& key) const + inline typename RefPtrHashMap::const_iterator RefPtrHashMap::find(const KeyType& key) const { return m_impl.find(key); } template - inline typename HashMap, U, V, W, X>::const_iterator HashMap, U, V, W, X>::find(RawKeyType key) const + inline typename RefPtrHashMap::const_iterator RefPtrHashMap::find(RawKeyType key) const { return m_impl.template find(key); } template - inline bool HashMap, U, V, W, X>::contains(const KeyType& key) const + inline bool RefPtrHashMap::contains(const KeyType& key) const { return m_impl.contains(key); } template - inline bool HashMap, U, V, W, X>::contains(RawKeyType key) const + inline bool RefPtrHashMap::contains(RawKeyType key) const { return m_impl.template contains(key); } template - inline pair, U, V, W, X>::iterator, bool> - HashMap, U, V, W, X>::inlineAdd(const KeyType& key, const MappedType& mapped) + inline pair::iterator, bool> + RefPtrHashMap::inlineAdd(const KeyType& key, const MappedType& mapped) { typedef HashMapTranslator TranslatorType; pair p = m_impl.template add(key, mapped); -// typename HashMap, U, V, W, X>::iterator temp = p.first; - return make_pair, U, V, W, X>::iterator, bool>( - typename HashMap, U, V, W, X>::iterator(p.first), p.second); +// typename RefPtrHashMap::iterator temp = p.first; + return make_pair::iterator, bool>( + typename RefPtrHashMap::iterator(p.first), p.second); // return m_impl.template add(key, mapped); } template - inline pair, U, V, W, X>::iterator, bool> - HashMap, U, V, W, X>::inlineAdd(RawKeyType key, const MappedType& mapped) + inline pair::iterator, bool> + RefPtrHashMap::inlineAdd(RawKeyType key, const MappedType& mapped) { pair p = m_impl.template add(key, mapped); - return make_pair, U, V, W, X>::iterator, bool>( - typename HashMap, U, V, W, X>::iterator(p.first), p.second); + return make_pair::iterator, bool>( + typename RefPtrHashMap::iterator(p.first), p.second); // return m_impl.template add(key, mapped); } template - pair, U, V, W, X>::iterator, bool> - HashMap, U, V, W, X>::set(const KeyType& key, const MappedType& mapped) + pair::iterator, bool> + RefPtrHashMap::set(const KeyType& key, const MappedType& mapped) { pair result = inlineAdd(key, mapped); if (!result.second) { @@ -237,8 +242,8 @@ namespace WTF { } template - pair, U, V, W, X>::iterator, bool> - HashMap, U, V, W, X>::set(RawKeyType key, const MappedType& mapped) + pair::iterator, bool> + RefPtrHashMap::set(RawKeyType key, const MappedType& mapped) { pair result = inlineAdd(key, mapped); if (!result.second) { @@ -249,22 +254,22 @@ namespace WTF { } template - pair, U, V, W, X>::iterator, bool> - HashMap, U, V, W, X>::add(const KeyType& key, const MappedType& mapped) + pair::iterator, bool> + RefPtrHashMap::add(const KeyType& key, const MappedType& mapped) { return inlineAdd(key, mapped); } template - pair, U, V, W, X>::iterator, bool> - HashMap, U, V, W, X>::add(RawKeyType key, const MappedType& mapped) + pair::iterator, bool> + RefPtrHashMap::add(RawKeyType key, const MappedType& mapped) { return inlineAdd(key, mapped); } template - typename HashMap, U, V, W, MappedTraits>::MappedType - HashMap, U, V, W, MappedTraits>::get(const KeyType& key) const + typename RefPtrHashMap::MappedType + RefPtrHashMap::get(const KeyType& key) const { ValueType* entry = const_cast(m_impl).lookup(key); if (!entry) @@ -273,8 +278,8 @@ namespace WTF { } template - typename HashMap, U, V, W, MappedTraits>::MappedType - inline HashMap, U, V, W, MappedTraits>::inlineGet(RawKeyType key) const + typename RefPtrHashMap::MappedType + inline RefPtrHashMap::inlineGet(RawKeyType key) const { ValueType* entry = const_cast(m_impl).template lookup(key); if (!entry) @@ -283,14 +288,14 @@ namespace WTF { } template - typename HashMap, U, V, W, MappedTraits>::MappedType - HashMap, U, V, W, MappedTraits>::get(RawKeyType key) const + typename RefPtrHashMap::MappedType + RefPtrHashMap::get(RawKeyType key) const { return inlineGet(key); } template - inline void HashMap, U, V, W, X>::remove(iterator it) + inline void RefPtrHashMap::remove(iterator it) { if (it.m_impl == m_impl.end()) return; @@ -299,45 +304,45 @@ namespace WTF { } template - inline void HashMap, U, V, W, X>::remove(const KeyType& key) + inline void RefPtrHashMap::remove(const KeyType& key) { remove(find(key)); } template - inline void HashMap, U, V, W, X>::remove(RawKeyType key) + inline void RefPtrHashMap::remove(RawKeyType key) { remove(find(key)); } template - inline void HashMap, U, V, W, X>::clear() + inline void RefPtrHashMap::clear() { m_impl.clear(); } template - typename HashMap, U, V, W, MappedTraits>::MappedType - HashMap, U, V, W, MappedTraits>::take(const KeyType& key) + typename RefPtrHashMap::MappedType + RefPtrHashMap::take(const KeyType& key) { // This can probably be made more efficient to avoid ref/deref churn. iterator it = find(key); if (it == end()) return MappedTraits::emptyValue(); - typename HashMap, U, V, W, MappedTraits>::MappedType result = it->second; + typename RefPtrHashMap::MappedType result = it->second; remove(it); return result; } template - typename HashMap, U, V, W, MappedTraits>::MappedType - HashMap, U, V, W, MappedTraits>::take(RawKeyType key) + typename RefPtrHashMap::MappedType + RefPtrHashMap::take(RawKeyType key) { // This can probably be made more efficient to avoid ref/deref churn. iterator it = find(key); if (it == end()) return MappedTraits::emptyValue(); - typename HashMap, U, V, W, MappedTraits>::MappedType result = it->second; + typename RefPtrHashMap::MappedType result = it->second; remove(it); return result; } -- cgit v0.12