3 ms·
I don't get it, can you give an example?
by bnegreve 11y ago
I don't get it, can you give an example?
- revelation 11y agoBig libraries like Boost and OpenCV usually have meta-headers for features and components that just include all the other headers for that particular part you want to use. (e.g. https://github.com/Itseez/opencv/blob/master/include/opencv2/opencv.hpp https://github.com/Itseez/opencv/blob/master/include/opencv2...) A tool like this would see right through that and walk the tree all the way to the final leaf headers that actually implement the parts you use. This not only means one single include will balloon to many smaller ones, but when the library moves things around internally your code will break. (Unclear if this is what this tool in particular will do, but I've certainly seen this behavior with Clion for example when it recommends what header to include.)
- maxlybbert 11y agoThe obvious one would be #include <windows.h>. I have never checked to see how big that file actually is, but it's not anywhere near what you would think based on what functions MSDN says need you to #include it for. The truth is, it #includes several other files, because Microsoft, in its infinite wisdom decided that, for the most part, programmers don't have to know what file a declaration is actually in, they just need to remember #include <windows.h>.