hash-map.h (hash_map::iterator::operator*): Return references to key and value.
authorRichard Biener <rguenther@suse.de>
Tue, 10 Jul 2018 13:02:34 +0000 (13:02 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 10 Jul 2018 13:02:34 +0000 (13:02 +0000)
2018-07-10  Richard Biener  <rguenther@suse.de>

* hash-map.h (hash_map::iterator::operator*): Return
references to key and value.

From-SVN: r262539

gcc/ChangeLog
gcc/hash-map.h

index 3230cf3aa82d4077ca4fcc6e1934865e5c2bacb4..f8717804b2aee377ee6239edd4f121718ce9c855 100644 (file)
@@ -1,3 +1,8 @@
+2018-07-10  Richard Biener  <rguenther@suse.de>
+
+       * hash-map.h (hash_map::iterator::operator*): Return
+       references to key and value.
+
 2018-07-10  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/86443
index 7861440f3b3e3d027fd3d9bce5cfa1e9346c3045..39848289d80c8efb847f3fb7a122ed5329f11299 100644 (file)
@@ -223,10 +223,10 @@ public:
       return *this;
     }
 
-    std::pair<Key, Value> operator* ()
+    std::pair<const Key&, Value&> operator* ()
     {
       hash_entry &e = *m_iter;
-      return std::pair<Key, Value> (e.m_key, e.m_value);
+      return std::pair<const Key&, Value&> (e.m_key, e.m_value);
     }
 
     bool