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 committed by Christopher Dunn
parent 5c4219b8ae
commit fe9663e7ed

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); }