Open tanya-kta opened 4 years ago
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
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?..
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: