Declare the namespace-scope constants in to_chars.hpp inline (#5776)

MSVC warns with C5260 that kAlpha and kGamma have internal linkage when
the header is used as a header unit or through a module. JSON_INLINE_VARIABLE
makes them inline variables from C++17 on.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann authored and GitHub committed 2026-10-07 09:03:18 +02:00
1 parent 24dd7c63f0
commit 30e542e52a
2 files changed
+4 -4

No files matched your search

@@ -308,8 +308,8 @@ boundaries compute_boundaries(FloatType value)
// //
// -e <= 60 or e >= -60 := alpha // -e <= 60 or e >= -60 := alpha
constexpr int kAlpha = -60; JSON_INLINE_VARIABLE constexpr int kAlpha = -60;
constexpr int kGamma = -32; JSON_INLINE_VARIABLE constexpr int kGamma = -32;
struct cached_power // c = f * 2^e ~= 10^k struct cached_power // c = f * 2^e ~= 10^k
{ {
+2 -2
View File
@@ -24445,8 +24445,8 @@ boundaries compute_boundaries(FloatType value)
// //
// -e <= 60 or e >= -60 := alpha // -e <= 60 or e >= -60 := alpha
constexpr int kAlpha = -60; JSON_INLINE_VARIABLE constexpr int kAlpha = -60;
constexpr int kGamma = -32; JSON_INLINE_VARIABLE constexpr int kGamma = -32;
struct cached_power // c = f * 2^e ~= 10^k struct cached_power // c = f * 2^e ~= 10^k
{ {