Skip to content

Commit

Permalink
Add the fix to the single_include
Browse files Browse the repository at this point in the history
I ran `make pretty` but that modified 20 files, performing a significant amount of indentation changes, none of them related to my change.
I ran `make amalgamate`, but that did nothing. Apparently, the make rule won't run if the single_include files have already been updated by `make pretty`.
I forced `make amalgamate` to do the work by touching the file with the fix.
I then decided to keep just the minimal needed change: the addition of the fix to the single_include file.

I just am not conversant enough in Linux to know whether I installed astyle correctly (had to clone the source from a beta branch and build, in order to get support for `--squeeze-lines`).
  • Loading branch information
TheJCAB committed Dec 8, 2023
1 parent 2eb72be commit 1402ca4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion single_include/nlohmann/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5697,7 +5697,14 @@ template<typename BasicJsonType, typename EnumType,
inline void to_json(BasicJsonType& j, EnumType e) noexcept
{
using underlying_type = typename std::underlying_type<EnumType>::type;
external_constructor<value_t::number_integer>::construct(j, static_cast<underlying_type>(e));
if (std::is_unsigned<underlying_type>::value)
{
external_constructor<value_t::number_unsigned>::construct(j, static_cast<underlying_type>(e));
}
else
{
external_constructor<value_t::number_integer>::construct(j, static_cast<underlying_type>(e));
}
}
#endif // JSON_DISABLE_ENUM_SERIALIZATION

Expand Down

0 comments on commit 1402ca4

Please sign in to comment.