From e95e7346a3ae04034c0a7533c5918ed31bcab4e3 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sat, 10 Oct 2026 21:56:37 +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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/nlohmann/json_view.hpp b/include/nlohmann/json_view.hpp index 3745faf1d..fa7c4e202 100644 --- a/include/nlohmann/json_view.hpp +++ b/include/nlohmann/json_view.hpp @@ -24,7 +24,9 @@ #ifndef INCLUDE_NLOHMANN_JSON_VIEW_HPP_ #define INCLUDE_NLOHMANN_JSON_VIEW_HPP_ -#include // size_t +#include // min +#include // array +#include // nullptr_t, size_t // IWYU pragma: keep #include // uint32_t #include // memcpy, strlen #include // distance, input_iterator_tag, iterator_traits