Include <span> where the split moved its only use

The #2546 test case guards itself with __has_include(<span>), but the
include itself sat in unit-regression2.cpp's preamble and stayed behind,
so the section compiled without a declaration wherever the guard passed -
which nvhpc reported and libc++ builds do not, as they skip the section
altogether.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann
2026-09-02 19:08:31 +02:00
parent 7b1ba66e1a
commit f21e0ee515
+7
View File
@@ -27,6 +27,7 @@ using json = nlohmann::json;
using ordered_json = nlohmann::ordered_json; using ordered_json = nlohmann::ordered_json;
#include <cmath> #include <cmath>
#include <cstddef>
#include <cstdint> #include <cstdint>
#include <limits> #include <limits>
#include <string> #include <string>
@@ -60,6 +61,12 @@ using ordered_json = nlohmann::ordered_json;
>; >;
#endif #endif
#ifdef JSON_HAS_CPP_20
#if __has_include(<span>)
#include <span>
#endif
#endif
#if JSON_HAS_RANGES == 1 #if JSON_HAS_RANGES == 1
#include <ranges> #include <ranges>
#endif #endif