Skip to content

Commit bbb77da

Browse files
committed
style: apply concat() suggestion and rerun make amalgamate
- Replaced std::string concatenation with concat() per maintainer feedback - Added missing newline in unit-serialize_enum_strict.cpp - Regenerated single-header files using make amalgamate for proper indentation Signed-off-by: Ash-Jose <ashlinjose986@outlook.com>
1 parent 28866e1 commit bbb77da

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

include/nlohmann/detail/macro_scope.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@
289289
{ \
290290
throw ::nlohmann::detail::type_error::create( \
291291
302, \
292-
std::string("invalid value for ") + #ENUM_TYPE + ": " + j.dump(), \
293-
nullptr); \
292+
concat("invalid value for ", #ENUM_TYPE, ": ", j.dump()), \
293+
j); \
294294
} \
295295
e = it->first; \
296296
}

single_include/nlohmann/json.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2653,8 +2653,8 @@ JSON_HEDLEY_DIAGNOSTIC_POP
26532653
{ \
26542654
throw ::nlohmann::detail::type_error::create( \
26552655
302, \
2656-
std::string("invalid value for ") + #ENUM_TYPE + ": " + j.dump(), \
2657-
nullptr); \
2656+
concat("invalid value for ", #ENUM_TYPE, ": ", j.dump()), \
2657+
j); \
26582658
} \
26592659
e = it->first; \
26602660
}

tests/src/unit-serialize_enum_strict.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ TEST_CASE("NLOHMANN_JSON_SERIALIZE_ENUM_STRICT still deserializes valid values")
2626
json j = "green";
2727
auto c = j.get<ns::Color>();
2828
CHECK(c == ns::Color::green);
29-
}
29+
}

0 commit comments

Comments
 (0)