Index: mojo/public/cpp/bindings/map.h |
diff --git a/mojo/public/cpp/bindings/map.h b/mojo/public/cpp/bindings/map.h |
index f09937a40046c98e9b5f2f1cb5e684191957af6b..7aa7b6f5707e5835b6c03335ce0145e6efabfb23 100644 |
--- a/mojo/public/cpp/bindings/map.h |
+++ b/mojo/public/cpp/bindings/map.h |
@@ -88,6 +88,11 @@ class Map { |
return Traits::at(&map_, key); |
} |
+ ValueRefType operator[](KeyForwardType key) { |
+ is_null_ = false; |
+ return Traits::GetOrInsert(&map_, key); |
+ } |
+ |
void Swap(Map<Key, Value>* other) { |
std::swap(is_null_, other->is_null_); |
map_.swap(other->map_); |