diff --git a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h index 82245f3..7298558 100644 --- a/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h +++ b/src/3rdparty/webkit/Source/JavaScriptCore/wtf/HashSet.h @@ -92,6 +92,17 @@ namespace WTF { friend void deleteAllValues<>(const HashSet&); friend void fastDeleteAllValues<>(const HashSet&); + // msvc2012 has trouble constructing a HashTableConstIteratorAdapter from a HashTableIterator + // despite the existence of a const_iterator cast method on the latter class. + pair iterator_const_cast(const pair& p) + { + // Spell out the full conversion chain for clarity, although any of the "hint" + // given by the alternatives below would have been enough. + return make_pair(iterator(HashTableType::const_iterator(p.first)), p.second); + // return make_pair(iterator(p.first), p.second); + // return make_pair(HashTableType::const_iterator(p.first), p.second); + } + HashTableType m_impl; }; @@ -177,7 +188,7 @@ namespace WTF { template inline pair::iterator, bool> HashSet::add(const ValueType& value) { - return m_impl.add(value); + return iterator_const_cast(m_impl.add(value)); } template @@ -186,7 +197,7 @@ namespace WTF { HashSet::add(const T& value) { typedef HashSetTranslatorAdapter Adapter; - return m_impl.template addPassingHashCode(value, value); + return iterator_const_cast(m_impl.template addPassingHashCode(value, value)); } template