diff --git a/include/nlohmann/json_view.hpp b/include/nlohmann/json_view.hpp index 7c41af7f3..4dc06cc86 100644 --- a/include/nlohmann/json_view.hpp +++ b/include/nlohmann/json_view.hpp @@ -27,7 +27,8 @@ #define INCLUDE_NLOHMANN_JSON_VIEW_HPP_ #include // all_of, min -#include // size_t +#include // array +#include // nullptr_t, size_t // IWYU pragma: keep #include // uint32_t #include // memcpy, strlen #include // distance, input_iterator_tag, iterator_traits @@ -45,6 +46,20 @@ #include // IWYU pragma: export +// json.hpp provides the library's types and macros used below (it includes +// the headers that define them); json_view.hpp must not include them again, +// because the amalgamated json_view.hpp only includes json.hpp +// IWYU pragma: no_include +// IWYU pragma: no_include "nlohmann/detail/abi_config.hpp" +// IWYU pragma: no_include "nlohmann/detail/abi_macros.hpp" +// IWYU pragma: no_include "nlohmann/detail/input/input_adapters.hpp" +// IWYU pragma: no_include "nlohmann/detail/json_pointer.hpp" +// IWYU pragma: no_include "nlohmann/detail/meta/cpp_future.hpp" +// IWYU pragma: no_include "nlohmann/detail/string_concat.hpp" +// IWYU pragma: no_include "nlohmann/detail/value_t.hpp" +// IWYU pragma: no_include "nlohmann/json.hpp" +// IWYU pragma: no_include "nlohmann/json_fwd.hpp" + // the view builds on internals of the library: both must be the same version #if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 12 || NLOHMANN_JSON_VERSION_PATCH != 0 #error "json_view.hpp requires json.hpp of the same version (3.12.0)" @@ -54,7 +69,6 @@ #include #include #include -#include #include #include #include diff --git a/single_include/nlohmann/json_view.hpp b/single_include/nlohmann/json_view.hpp index 89e8e67c2..653dbcd66 100644 --- a/single_include/nlohmann/json_view.hpp +++ b/single_include/nlohmann/json_view.hpp @@ -27,7 +27,8 @@ #define INCLUDE_NLOHMANN_JSON_VIEW_HPP_ #include // all_of, min -#include // size_t +#include // array +#include // nullptr_t, size_t // IWYU pragma: keep #include // uint32_t #include // memcpy, strlen #include // distance, input_iterator_tag, iterator_traits @@ -45,6 +46,20 @@ #include // IWYU pragma: export +// json.hpp provides the library's types and macros used below (it includes +// the headers that define them); json_view.hpp must not include them again, +// because the amalgamated json_view.hpp only includes json.hpp +// IWYU pragma: no_include +// IWYU pragma: no_include "nlohmann/detail/abi_config.hpp" +// IWYU pragma: no_include "nlohmann/detail/abi_macros.hpp" +// IWYU pragma: no_include "nlohmann/detail/input/input_adapters.hpp" +// IWYU pragma: no_include "nlohmann/detail/json_pointer.hpp" +// IWYU pragma: no_include "nlohmann/detail/meta/cpp_future.hpp" +// IWYU pragma: no_include "nlohmann/detail/string_concat.hpp" +// IWYU pragma: no_include "nlohmann/detail/value_t.hpp" +// IWYU pragma: no_include "nlohmann/json.hpp" +// IWYU pragma: no_include "nlohmann/json_fwd.hpp" + // the view builds on internals of the library: both must be the same version #if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 12 || NLOHMANN_JSON_VERSION_PATCH != 0 #error "json_view.hpp requires json.hpp of the same version (3.12.0)" @@ -4119,8 +4134,6 @@ class editor } // namespace detail NLOHMANN_JSON_NAMESPACE_END -// #include - // #include // #include