-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing #includes based on C++ language server. #4477
base: develop
Are you sure you want to change the base?
Conversation
Honestly I don't see the benefit of including https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/WhyIWYU.md
The thing this is mostly doing is increasing the compile time by adding extra includes of header files that are already included.
I would say that this is a small codebase, and not only is it practical to just compile it, it is basically required by the amalgamation. Removing |
I am also hesitant: it seems to fix a problem we don't have. |
These includes follow the "Include-what-you-spell" principle; c++ language servers highlight these are missing. RE macro_scope. Shouldn't each #include of that file be matched by an include of macro_unscope? |
This change violates the IWYU
No, it's included once at https://github.com/nlohmann/json/blob/develop/include/nlohmann/json.hpp#L5256. The headers in the |
I have removed most of the #includes changes, audited the use of macro_scope vs abi_macros to only include one or the other, and to avoid all includes of hedley outside of macro scope. I added an IWYU pragma comment to macro_scope to make the language server happy. The other include changes are for types used in files which have no exports. PTAL |
Can you please rebase to the develop branch? I'll check this then. |
Add missing #includes based on IWYU service.
Mostly this adds
#include <nlohmann/detail/abi_macros.hpp>
sinceNLOHMANN_JSON_NAMESPACE_BEGIN
appearsnearly everywhere.
It adds a few other includes as well.