File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -918,8 +918,8 @@ class JSON_API ValueIterator : public ValueIteratorBase {
918
918
* because the returned references/pointers can be used
919
919
* to change state of the base class.
920
920
*/
921
- reference operator *() { return deref (); }
922
- pointer operator ->() { return &deref (); }
921
+ reference operator *() const { return const_cast <reference>( deref () ); }
922
+ pointer operator ->() const { return const_cast <pointer>( &deref () ); }
923
923
};
924
924
925
925
inline void swap (Value& a, Value& b) { a.swap (b); }
Original file line number Diff line number Diff line change @@ -3724,7 +3724,7 @@ JSONTEST_FIXTURE_LOCAL(IteratorTest, reverseIterator) {
3724
3724
using Iter = decltype (json.begin ());
3725
3725
auto re = std::reverse_iterator<Iter>(json.begin ());
3726
3726
for (auto it = std::reverse_iterator<Iter>(json.end ()); it != re; ++it) {
3727
- values.push_back ((*it). asString ());
3727
+ values.push_back (it-> asString ());
3728
3728
}
3729
3729
JSONTEST_ASSERT ((values == std::vector<std::string>{" b" , " a" }));
3730
3730
}
You can’t perform that action at this time.
0 commit comments