We have a large code base in C++ that makes uses of precompiled headers. Visual Studio 17.8 introduced a “clean up” feature for C++ which (in part) looks for transitively included headers and suggests that they be directly included.
Does anyone have any suggestions about how to get the clean up feature playing nicely with precompiled headers? Anything that’s coming from the precompiled header will be identified as transitive and the suggestion will be to make it a direct include. Is this good advice though? It would seem to just create duplicates (at best) of the needed includes. Which, maybe, defeats the idea behind precompiled headers. Do this enough and you won’t need the precompiled header at all. Again, this is going against the purpose of precompiled headers!
The clean up feature looks nice in principle, but if it’s going to complain about includes from precompiled headers than it will be difficult to identify good advice from “false positives” and probably just get switched off.
I’d be interested to hear about other developer’s experiences with this new(ish) feature.