-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor includes of files and libraries #13
Labels
Comments
Btw, the order of includes matters for CLion: if A is included in B, and you want to include both A and B to C, then you should include A first and B after that. Example: // a.cpp
void f1() {} // b.cpp
#include "a.cpp"
void f2()
{
f1();
} // c.cpp (bad)
#include "b.cpp"
#include "a.cpp"
// use f1, f2 // c.cpp (good)
#include "a.cpp"
#include "b.cpp"
// use f1, f2 |
kolayne
added a commit
that referenced
this issue
Sep 19, 2020
Please, note, that it is not related to #13
kolayne
added a commit
that referenced
this issue
Sep 19, 2020
Please, note, that it is not related to #13
If there are, for example, "something.hpp" and "something.cpp" files, and the hpp file includes something which cpp wants to use, should we include it in cpp again?.. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Check all includes and rewrite them to follow the rule: all files and libraries used in file A has to be included in file A, even if some of them are already included through other files. Also check for other problems such as unused includes. For example:
Incorrect:
Correct:
The text was updated successfully, but these errors were encountered: