I'm using Boost Geometry for my Visual studio 2012 project, and ever since I added it my code hints have been getting really slow.
When I type a variable name and wait for the code hint, I see 'Parsing files in solution..' in the bottom of the screen. The code hints don't show up until that disappears.
Does anyone have a suggestion what to do? My next move would be to only include the boost headers in the files that need them, instead of the precompiled headers, but I find this more neat.
Have you ever looked at the output of the preprocessor on a C++ program? It's huge.
As a rule, you should provide as little as you can get away with for each compiled unit. That means forward declaring objects when you can, and designing your objects such that they can be forward declared.
The use of pre-compiled headers implies that it's cleaper to do the opposite; that is, put as many declarations in the common header file. But that isn't the best way to work. As you're now seeing, even the use of PCH's cannot optimize away the effects of including lots of redundant headers.
IntelliSense does have problems with large amount of code symbols arounf. Boost is a main offender, but any project large enough (Like Unreal Engine) will provoke same problems.
People tends to disable IntelliSense and use Visual Assist instead.
So, I should not include the boost headers in the precompiled headers? I already make a habit of including as little as possible, but PCH do help when I modify small files with big dependencies a lot.
Visual Assist seems like a nice option, but right now I'd rather not spend money on such a thing.
Thanks!
but PCH do help when I modify small files with big dependencies
It is possible reduce the dependencies between files. The guiding principle is "Just because you can include the complete definition of an object, doesn't mean you should."