Json::ValueIterator operators * and -> need to be const

Fixes #1249.
This commit is contained in:
Billy Donahue 2020-12-21 04:41:37 -05:00
parent 940982438d
commit 6491cb9395

View File

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