diff --git a/include/nlohmann/detail/output/serializer.hpp b/include/nlohmann/detail/output/serializer.hpp index e2d47f75a..c8aeffbb9 100644 --- a/include/nlohmann/detail/output/serializer.hpp +++ b/include/nlohmann/detail/output/serializer.hpp @@ -694,7 +694,7 @@ class serializer std::size_t write_u_escape(std::size_t pos, std::uint16_t codeunit) noexcept { JSON_ASSERT(string_buffer.size() - pos >= 6); - static constexpr const char nibble_to_hex[] = "0123456789abcdef"; + constexpr const char* nibble_to_hex = "0123456789abcdef"; string_buffer[pos + 0] = '\\'; string_buffer[pos + 1] = 'u'; string_buffer[pos + 2] = nibble_to_hex[(codeunit >> 12u) & 0x0Fu]; diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 6e69c8c4d..ec3ac9ebd 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -19981,7 +19981,7 @@ class serializer std::size_t write_u_escape(std::size_t pos, std::uint16_t codeunit) noexcept { JSON_ASSERT(string_buffer.size() - pos >= 6); - static constexpr const char nibble_to_hex[] = "0123456789abcdef"; + constexpr const char* nibble_to_hex = "0123456789abcdef"; string_buffer[pos + 0] = '\\'; string_buffer[pos + 1] = 'u'; string_buffer[pos + 2] = nibble_to_hex[(codeunit >> 12u) & 0x0Fu];