json/include/nlohmann/detail
Florian Albrechtskirchinger 700b95f447
Make iterator operator++/--(int) equality-preserving (#3332)
Commit f28fc22 introduced const qualifiers on post-(inc-/dec-)rement
operators of iterators. These qualifiers prevent the use of basic_json
in place of std::ranges::range, which requires the post-increment
operator to be equality-preserving.

These changes appear to be the result of ICC compiler suggestions, and
no further explanation is discernible from the PR discussion (#858).
Further testing revealed, that clang-tidy also suggests adding const to
prevent "accidental mutation of a temporary object".

As an alternative, this commit partially reverts f28fc22, removing all
added const qualifiers from return types and adds lvalue reference
qualifiers to the operator member functions instead.

Unit tests ensure the operators remain equality-preserving and
accidental mutation of temporaries following post-(inc-/dec-)rement is
prohibited.

Fixes #3331.
2022-03-08 10:10:50 +01:00
..
conversions Consolidate documentation (#3071) 2021-12-29 13:41:01 +01:00
input Consolidate documentation (#3071) 2021-12-29 13:41:01 +01:00
iterators Make iterator operator++/--(int) equality-preserving (#3332) 2022-03-08 10:10:50 +01:00
meta Add C++17 copies of the test binaries (#3101) 2021-12-29 09:47:05 +01:00
output ♻️ make function static 2022-01-05 21:21:46 +01:00
exceptions.hpp Consolidate documentation (#3071) 2021-12-29 13:41:01 +01:00
hash.hpp 🐛 adding missing header 2021-08-18 13:33:35 +02:00
json_pointer.hpp Consolidate documentation (#3071) 2021-12-29 13:41:01 +01:00
json_ref.hpp 🚨 add new CI and fix warnings (#2561) 2021-03-24 07:15:18 +01:00
macro_scope.hpp Add macros NLOHMANN_DEFINE_TYPE_INTRUSIVE_WITH_DEFAULT and ..._NON_INTRUSIVE_WITH_DEFAULT (#3143) 2022-01-30 22:06:50 +01:00
macro_unscope.hpp Add C++17 copies of the test binaries (#3101) 2021-12-29 09:47:05 +01:00
string_escape.hpp 🐛 proper JSON Pointer escape in diagnostic messages 2021-01-16 15:33:05 +01:00
value_t.hpp 🚨 fix warnings 2021-01-10 13:39:36 +01:00