From d92cb38f2b6103f81ae01bc0752656e73329ae85 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sat, 10 Oct 2026 21:56:36 +0200 Subject: [PATCH] Make json_view.hpp pass include-what-you-use ci_single_binaries runs IWYU with --error on every header. For json_view.hpp it suggested adding (std::array is used), the headers that json.hpp already provides (abi_config, abi_macros, input_adapters, json_pointer, cpp_future, string_concat, value_t, json_fwd), and for std::nullptr_t, and removing . - include - keep (nullptr_t, size_t; IWYU attributes them to and ) - tell IWYU not to suggest the headers that json.hpp provides: the amalgamated json_view.hpp only includes json.hpp, so including them here would duplicate their definitions Signed-off-by: Niels Lohmann --- include/nlohmann/json_view.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/nlohmann/json_view.hpp b/include/nlohmann/json_view.hpp index e6b0aeec8..351106311 100644 --- a/include/nlohmann/json_view.hpp +++ b/include/nlohmann/json_view.hpp @@ -25,7 +25,8 @@ #define INCLUDE_NLOHMANN_JSON_VIEW_HPP_ #include // min -#include // size_t +#include // array +#include // nullptr_t, size_t // IWYU pragma: keep #include // memcpy, strlen #include // distance, input_iterator_tag, iterator_traits #include // map