Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The tool for deal with this is https://include-what-you-use.org/

The idea is that each file (source or header) should include exactly those headers from which it uses things. In practice, it gets a bit more complicated has you don't want to include internal implementation headers and sometimes the same thing does not even have a canonical public header but IWUY does allow you to configure all that to your liking.



Great point. And this will soon be available directly from Clang tools such as clangd, which will make life much easier.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: