Allow the string literal parameter of the view serializer's put() for clang-tidy

The overload takes the literal by array reference so that its length is a
template parameter, like scan_literal() and the C array overloads of
to_json() and from_json().

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-19 22:07:28 +02:00
1 parent 477f3c7c3d
commit c584674a8a
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -71,7 +71,7 @@ class output_buffer
/// a string literal, without its terminating NUL /// a string literal, without its terminating NUL
template<std::size_t N> template<std::size_t N>
NLOHMANN_VIEW_ALWAYS_INLINE void put(const char (&s)[N]) NLOHMANN_VIEW_ALWAYS_INLINE void put(const char (&s)[N]) // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
{ {
put(s, N - 1); put(s, N - 1);
} }
+1 -1
View File
@@ -3415,7 +3415,7 @@ class output_buffer
/// a string literal, without its terminating NUL /// a string literal, without its terminating NUL
template<std::size_t N> template<std::size_t N>
NLOHMANN_VIEW_ALWAYS_INLINE void put(const char (&s)[N]) NLOHMANN_VIEW_ALWAYS_INLINE void put(const char (&s)[N]) // NOLINT(cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
{ {
put(s, N - 1); put(s, N - 1);
} }