Chromium Code Reviews| Index: mojo/public/cpp/bindings/map_traits_wtf_hash_map.h |
| diff --git a/mojo/public/cpp/bindings/map_traits_wtf_hash_map.h b/mojo/public/cpp/bindings/map_traits_wtf_hash_map.h |
| index 439220130e85874fd98379d7a1bc9b9fce494b0f..88ee3bf5c8b9d65d85449a027e5aecf001a0fe78 100644 |
| --- a/mojo/public/cpp/bindings/map_traits_wtf_hash_map.h |
| +++ b/mojo/public/cpp/bindings/map_traits_wtf_hash_map.h |
| @@ -46,12 +46,13 @@ struct MapTraits<WTF::HashMap<K, V>> { |
| static V& GetValue(Iterator& iterator) { return iterator->value; } |
| static const V& GetValue(ConstIterator& iterator) { return iterator->value; } |
| - static bool Insert(WTF::HashMap<K, V>& input, const K& key, V&& value) { |
| + template <typename IK, typename IV> |
| + static bool Insert(WTF::HashMap<K, V>& input, IK&& key, IV&& value) { |
| if (!WTF::HashMap<K, V>::isValidKey(key)) { |
| LOG(ERROR) << "The key value is disallowed by WTF::HashMap: " << key; |
| return false; |
| } |
| - input.add(key, std::forward<V>(value)); |
| + input.add(std::forward<IK>(key), std::forward<IV>(value)); |
| return true; |
| } |
| static bool Insert(WTF::HashMap<K, V>& input, const K& key, const V& value) { |
|
yzshen1
2016/09/20 23:44:40
Do we still need this method?
tibell
2016/09/21 07:10:53
Done.
|