mirror of
https://github.com/nlohmann/json.git
synced 2026-02-23 20:06:25 +00:00
Fix C++20/gcc-12 issues (Part 2) (#3446)
* Add C++20 3-way comparison operator and fix broken comparisons Fixes #3207. Fixes #3409. * Fix iterators to meet (more) std::ranges requirements Fixes #3130. Related discussion: #3408 * Add note about CMake standard version selection to unit tests Document how CMake chooses which C++ standard version to use when building tests. * Update documentation * CI: add legacy discarded value comparison * Fix internal linkage errors when building a module
This commit is contained in:
committed by
GitHub
parent
ede6667858
commit
6b97599a27
@@ -1454,17 +1454,17 @@ TEST_CASE("parser class")
|
||||
|
||||
SECTION("filter specific element")
|
||||
{
|
||||
json j_object = json::parse(s_object, [](int /*unused*/, json::parse_event_t /*unused*/, const json & j) noexcept
|
||||
json j_object = json::parse(s_object, [](int /*unused*/, json::parse_event_t event, const json & j) noexcept
|
||||
{
|
||||
// filter all number(2) elements
|
||||
return j != json(2);
|
||||
return event != json::parse_event_t::value || j != json(2);
|
||||
});
|
||||
|
||||
CHECK (j_object == json({{"bar", {{"baz", 1}}}}));
|
||||
|
||||
json j_array = json::parse(s_array, [](int /*unused*/, json::parse_event_t /*unused*/, const json & j) noexcept
|
||||
json j_array = json::parse(s_array, [](int /*unused*/, json::parse_event_t event, const json & j) noexcept
|
||||
{
|
||||
return j != json(2);
|
||||
return event != json::parse_event_t::value || j != json(2);
|
||||
});
|
||||
|
||||
CHECK (j_array == json({1, {3, 4, 5}, 4, 5}));
|
||||
|
||||
Reference in New Issue
Block a user