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

Unified Diff: Source/wtf/HashMap.h

Issue 1129373003: New return value syntax for HashTable and HashMap nested types Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | Source/wtf/HashTable.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/HashMap.h
diff --git a/Source/wtf/HashMap.h b/Source/wtf/HashMap.h
index 850c2054bc7536bf7bf4141c5d93b8a2e306b1ee..fd27b8b766ebf970a447801b4c6898cdd4179cd8 100644
--- a/Source/wtf/HashMap.h
+++ b/Source/wtf/HashMap.h
@@ -287,37 +287,37 @@ namespace WTF {
}
template<typename T, typename U, typename V, typename W, typename X, typename Y>
- inline typename HashMap<T, U, V, W, X, Y>::iterator HashMap<T, U, V, W, X, Y>::begin()
+ inline auto HashMap<T, U, V, W, X, Y>::begin() -> iterator
{
return m_impl.begin();
}
template<typename T, typename U, typename V, typename W, typename X, typename Y>
- inline typename HashMap<T, U, V, W, X, Y>::iterator HashMap<T, U, V, W, X, Y>::end()
+ inline auto HashMap<T, U, V, W, X, Y>::end() -> iterator
{
return m_impl.end();
}
template<typename T, typename U, typename V, typename W, typename X, typename Y>
- inline typename HashMap<T, U, V, W, X, Y>::const_iterator HashMap<T, U, V, W, X, Y>::begin() const
+ inline auto HashMap<T, U, V, W, X, Y>::begin() const -> const_iterator
{
return m_impl.begin();
}
template<typename T, typename U, typename V, typename W, typename X, typename Y>
- inline typename HashMap<T, U, V, W, X, Y>::const_iterator HashMap<T, U, V, W, X, Y>::end() const
+ inline auto HashMap<T, U, V, W, X, Y>::end() const -> const_iterator
{
return m_impl.end();
}
template<typename T, typename U, typename V, typename W, typename X, typename Y>
- inline typename HashMap<T, U, V, W, X, Y>::iterator HashMap<T, U, V, W, X, Y>::find(KeyPeekInType key)
+ inline auto HashMap<T, U, V, W, X, Y>::find(KeyPeekInType key) -> iterator
{
return m_impl.find(key);
}
template<typename T, typename U, typename V, typename W, typename X, typename Y>
- inline typename HashMap<T, U, V, W, X, Y>::const_iterator HashMap<T, U, V, W, X, Y>::find(KeyPeekInType key) const
+ auto HashMap<T, U, V, W, X, Y>::find(KeyPeekInType key) const -> const_iterator
{
return m_impl.find(key);
}
@@ -330,16 +330,14 @@ namespace WTF {
template<typename T, typename U, typename V, typename W, typename X, typename Y>
template<typename HashTranslator, typename TYPE>
- inline typename HashMap<T, U, V, W, X, Y>::iterator
- HashMap<T, U, V, W, X, Y>::find(const TYPE& value)
+ auto HashMap<T, U, V, W, X, Y>::find(const TYPE& value) -> iterator
{
return m_impl.template find<HashMapTranslatorAdapter<ValueTraits, HashTranslator>>(value);
}
template<typename T, typename U, typename V, typename W, typename X, typename Y>
template<typename HashTranslator, typename TYPE>
- inline typename HashMap<T, U, V, W, X, Y>::const_iterator
- HashMap<T, U, V, W, X, Y>::find(const TYPE& value) const
+ auto HashMap<T, U, V, W, X, Y>::find(const TYPE& value) const -> const_iterator
{
return m_impl.template find<HashMapTranslatorAdapter<ValueTraits, HashTranslator>>(value);
}
@@ -353,15 +351,13 @@ namespace WTF {
}
template<typename T, typename U, typename V, typename W, typename X, typename Y>
- typename HashMap<T, U, V, W, X, Y>::AddResult
- HashMap<T, U, V, W, X, Y>::inlineAdd(KeyPeekInType key, MappedPassInReferenceType mapped)
+ auto HashMap<T, U, V, W, X, Y>::inlineAdd(KeyPeekInType key, MappedPassInReferenceType mapped) -> AddResult
{
return m_impl.template add<HashMapTranslator<ValueTraits, HashFunctions>>(key, mapped);
}
template<typename T, typename U, typename V, typename W, typename X, typename Y>
- typename HashMap<T, U, V, W, X, Y>::AddResult
- HashMap<T, U, V, W, X, Y>::set(KeyPeekInType key, MappedPassInType mapped)
+ auto HashMap<T, U, V, W, X, Y>::set(KeyPeekInType key, MappedPassInType mapped) -> AddResult
{
AddResult result = inlineAdd(key, mapped);
if (!result.isNewEntry) {
@@ -373,22 +369,19 @@ namespace WTF {
template<typename T, typename U, typename V, typename W, typename X, typename Y>
template<typename HashTranslator, typename TYPE>
- typename HashMap<T, U, V, W, X, Y>::AddResult
- HashMap<T, U, V, W, X, Y>::add(const TYPE& key, MappedPassInType value)
+ auto HashMap<T, U, V, W, X, Y>::add(const TYPE& key, MappedPassInType value) -> AddResult
{
return m_impl.template addPassingHashCode<HashMapTranslatorAdapter<ValueTraits, HashTranslator>>(key, value);
}
template<typename T, typename U, typename V, typename W, typename X, typename Y>
- typename HashMap<T, U, V, W, X, Y>::AddResult
- HashMap<T, U, V, W, X, Y>::add(KeyPeekInType key, MappedPassInType mapped)
+ auto HashMap<T, U, V, W, X, Y>::add(KeyPeekInType key, MappedPassInType mapped) -> AddResult
{
return inlineAdd(key, mapped);
}
template<typename T, typename U, typename V, typename W, typename X, typename Y>
- typename HashMap<T, U, V, W, X, Y>::MappedPeekType
- HashMap<T, U, V, W, X, Y>::get(KeyPeekInType key) const
+ auto HashMap<T, U, V, W, X, Y>::get(KeyPeekInType key) const -> MappedPeekType
{
ValueType* entry = const_cast<HashTableType&>(m_impl).lookup(key);
if (!entry)
@@ -415,8 +408,7 @@ namespace WTF {
}
template<typename T, typename U, typename V, typename W, typename X, typename Y>
- typename HashMap<T, U, V, W, X, Y>::MappedPassOutType
- HashMap<T, U, V, W, X, Y>::take(KeyPeekInType key)
+ auto HashMap<T, U, V, W, X, Y>::take(KeyPeekInType key) -> MappedPassOutType
{
iterator it = find(key);
if (it == end())
« no previous file with comments | « no previous file | Source/wtf/HashTable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698