From ee4a6535f02018c715801b6b35bbac1552748b77 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Sat, 10 Oct 2026 21:56:38 +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 - drop edit_storage.hpp, which edit.hpp includes 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 ddd970ef3..e8fd2f725 100644 --- a/include/nlohmann/json_view.hpp +++ b/include/nlohmann/json_view.hpp @@ -26,7 +26,9 @@ #ifndef INCLUDE_NLOHMANN_JSON_VIEW_HPP_ #define INCLUDE_NLOHMANN_JSON_VIEW_HPP_ -#include // size_t +#include // all_of, min +#include // array +#include // nullptr_t, size_t // IWYU pragma: keep #include // uint8_t, uint32_t #include // memcpy, strlen #include // distance, input_iterator_tag, iterator_traits