`Json::ValueIterator` operators `*` and `->` need to be const
Fixes #1249.
diff --git a/include/json/value.h b/include/json/value.h
index ec9af56..7ec4185 100644
--- a/include/json/value.h
+++ b/include/json/value.h
@@ -918,8 +918,8 @@
* because the returned references/pointers can be used
* to change state of the base class.
*/
- reference operator*() { return deref(); }
- pointer operator->() { return &deref(); }
+ reference operator*() const { return const_cast<reference>(deref()); }
+ pointer operator->() const { return const_cast<pointer>(&deref()); }
};
inline void swap(Value& a, Value& b) { a.swap(b); }