Boost logo

Boost :

Subject: [boost] [preprocessor] include speed question
From: lcaminiti (lorcaminiti_at_[hidden])
Date: 2012-05-10 12:30:29

Hello all,

I have a general question about what's the best way to include files that
results in faster compilation time.

In my example, I have *a lot* of files that use different parts of
Boost.Preprocessor. Each header includes the specific Boost.Preprocessor
headers that it needs. As a results the same Boost.Preprocessor header and
#included many times (50+?) even if the including has no effect after the
first inclusion. Furthermore, at the end essentially all Boost.Preprocessor
header get included.

This way is more module in that each single file includes all the headers
that it needs. But, does that slow down compilation? Would it be faster to
just #include <boost/preprocessor.hpp> just once into a front-end header
that then includes all my single header files? (Maybe with modern compilers
and file-systems this makes no difference?)

Thanks a lot.

View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at