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 @@ public: * 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(deref()); } + pointer operator->() const { return const_cast(&deref()); } }; inline void swap(Value& a, Value& b) { a.swap(b); }