From 67756a568fe6addb2a85a9d7f56d731927365e68 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sat, 10 Oct 2026 21:51:23 +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), and the headers that json.hpp already provides (abi_config, abi_macros, input_adapters, json_pointer, cpp_future, string_concat, value_t, json_fwd), plus for std::nullptr_t, and removing and edit_storage.hpp. - 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 - drop edit_storage.hpp, which edit.hpp includes Signed-off-by: Niels Lohmann --- include/nlohmann/json_view.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/nlohmann/json_view.hpp b/include/nlohmann/json_view.hpp index 0a2382c9c..244f33a8f 100644 --- a/include/nlohmann/json_view.hpp +++ b/include/nlohmann/json_view.hpp @@ -26,8 +26,9 @@ #ifndef INCLUDE_NLOHMANN_JSON_VIEW_HPP_ #define INCLUDE_NLOHMANN_JSON_VIEW_HPP_ -#include // all_of -#include // size_t +#include // all_of, min +#include // array +#include // nullptr_t, size_t // IWYU pragma: keep #include // uint32_t #include // memcpy, strlen #include // distance, input_iterator_tag, iterator_traits @@ -68,7 +69,6 @@ #include #include #include -#include #include #include #include