Ensure that assignment gestures through CDMap iterators like:
authorMorgan Deters <mdeters@gmail.com>
Fri, 2 Sep 2011 19:23:18 +0000 (19:23 +0000)
committerMorgan Deters <mdeters@gmail.com>
Fri, 2 Sep 2011 19:23:18 +0000 (19:23 +0000)
  (*myCDMap.find(foo)).second = bar;

fail with a compile-time error (rather than being silently ignored, like
they had been).

Resolves bug #276.

src/context/cdmap.h

index 1e7e931da259f6ea939aafaac65fa985be1a20f0..c714598357d35f9153c926ad32594f0f17af76b4 100644 (file)
@@ -514,8 +514,8 @@ public:
     }
 
     // Dereference operators.
-    std::pair<const Key, Data> operator*() const {
-      return std::pair<const Key, Data>(d_it->getKey(), d_it->get());
+    std::pair<const Key, const Data> operator*() const {
+      return std::pair<const Key, const Data>(d_it->getKey(), d_it->get());
     }
 
     // Prefix increment