json/test
Florian Albrechtskirchinger b926357635 Make iterator operator++/--(int) equality-preserving
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-02-17 09:56:01 +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_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 2022-02-17 09:56:01 +01:00
thirdparty Fix extra ";" clang warnings 2021-08-19 17:04:34 +02:00
CMakeLists.txt Add C++17 copies of the test binaries (#3101) 2021-12-29 09:47:05 +01:00
Makefile 🔥 remove test Makefile targets (all handled by CMake) 2020-07-16 13:38:25 +02:00