Slow code hinting when using Boost headers

Hi everyone,

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.

More information:
Libraries I use:
1
2
3
4
#include <boost/geometry/geometry.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/multi/geometries/multi_polygon.hpp> 


These are in a precompiled header, so every file uses them.
On the page of these libraries (http://www.boost.org/doc/libs/1_49_0/libs/geometry/doc/html/geometry/compilation.html) it does describe the problem (at the bottom), but this solution doesn't work and doesn't seem very elegant.

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.

Thanks!
... 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."
I've decided to try Visual Assist, looks like I'm gonna have to purchase after all ;) Thanks for the tip!
Go for the trial version first. Then decide if you are relly need it.
Doing just that!
Topic archived. No new replies allowed.