From: Luis G. <lui...@us...> - 2010-12-15 08:59:58
|
On Tue, Dec 14, 2010 at 11:10 PM, Tim E. Real <ter...@ro...> wrote: > At first all.h was empty. But when I added deicsonze and the Awl and some > other AL files, I filled it in because it's filled in evolution. > In evolution all the files have very minimal includes, referring instead to > the all.h file. > I had begun to manually add all the necessary includes to each of those > additions, but then realized it was easier to fill up all.h > > Does it cause unnecessary excess bloat? Not sure. My gut feeling is yes, > but I was hoping no, that the compiler only grabs what is needed? If you follow Qt examples, what they usually do is to pre-declare the class in the header file (as long as you are not instancing or inheriting it, otherwise you need to #include it) and then #include it in the cpp file (sometimes they use "big #includes" like <QtGui>). See, for instance: http://doc.qt.nokia.com/latest/widgets-calculator.html Allegedly this speeds up the compilation process, and I personally don't find hard to follow this practice, but YMMV. Performance-wise I haven't benchmarked it against PCH. Apparently PCH support is not perfect in some platforms/gcc versions, but that's probably not an issue nowadays. http://doc.trolltech.com/latest/platform-notes-mac.html#qt-and-precompiled-headers-pch. Luis |