json/test
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
..
cmake_add_subdirectory annotate non-reproducible tests #2324 2020-08-30 13:23:34 +02:00
cmake_fetch_content 🐛 properly assign two labels to one test case #2596 2021-01-27 14:22:58 +01:00
cmake_fetch_content2 FetchContent_MakeAvailable (#3351) 2022-03-06 15:33:05 +01:00
cmake_import annotate non-reproducible tests #2324 2020-08-30 13:23:34 +02:00
cmake_import_minver annotate non-reproducible tests #2324 2020-08-30 13:23:34 +02:00
cmake_target_include_directories annotate non-reproducible tests #2324 2020-08-30 13:23:34 +02:00
cuda_example Fix compilation error with NVCC (#3234) 2022-01-02 09:03:56 +01:00
reports added fuzzing results 2016-10-02 11:23:47 +02:00
src Make iterator operator++/--(int) equality-preserving (#3332) 2022-03-08 10:10:50 +01:00
thirdparty Fix extra ";" clang warnings 2021-08-19 17:04:34 +02:00
CMakeLists.txt FetchContent_MakeAvailable (#3351) 2022-03-06 15:33:05 +01:00
Makefile 🔥 remove test Makefile targets (all handled by CMake) 2020-07-16 13:38:25 +02:00