문제

I've started working on a project that has a shed load of imports in the pch file.

Why would someone do this? Lazyness?

I guess if I refactor them out, I could potentially decrease compile times..... is that so?

도움이 되었습니까?

해결책

No, not unless it's importing things that are changing frequently. The point of the precompiled header is that it combines lots of code that changes very infrequently into an intermediate format to decrease compilation times. If you take stuff out, it has to process each of the imports normally instead of using the intermediate format.

Taking things out of the precompiled header generally slows down the compile times. The exception to this is if you are importing stuff that you are changing on a regular basis, as this would defeat the purpose of it by forcing it to compile it each time.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top