PDA

View Full Version : Doubt about includes



xEsk
15th November 2007, 15:19
Hi,

I have a doubt.

What's better (it is just an example):
#include <GtGui>or
#include <QDir>
#include <QFileInfo>
#include <QTranslator>
...

I'm studing some Qt4 applications (source code) and all of them define all the individual includes, when using the #include <GtGui> all includes are "included". What we win defining all the includes individually?

Best regards, xEsk.

jacek
15th November 2007, 15:28
When you include all of the headers, the preprocessor and the compiler have to read all of them from the disk and then parse them. This takes time, although it's only a problem if you don't use precompiled headers.

xEsk
15th November 2007, 20:20
Ok, thank's!