Is it really worth the trouble? Use precompiled headers and your problem will disappear (along side a 100MB of your disk space).
Is it really worth the trouble? Use precompiled headers and your problem will disappear (along side a 100MB of your disk space).
You should know, it's your code
When you use precompiled headers this is more or less the amount of spaces those headers take after precompilation.2. why 100MB !!!
We've been all over this question... It's not recommended in this particular case, just include the vector and skip to some more interesting work.3. When Does the forward declaration is recommended
Concerning (1) -- because STL container classes use enough template magic that forward-declaring them is a pain.
As for (3) -- forward declaration is mostly to speed up compilation times. Precompiled headers take care of that problem to some extent by only compiling the header part once, eliminating most of the overhead (so that the vector header doesn't need to be parsed every time a file is compiled that includes your class header that uses it).
In this case, obviously the effort to forward-declare a vector isn't worth the small time savings during compilation.
Bookmarks