Boost logo

Boost :

From: Alberto Barbati (abarbati_at_[hidden])
Date: 2002-12-29 06:22:31


Gennaro Prota wrote:
> [snip] The fact that it is useful to reduce compilation
> time is just a result of some compiler writers' attitude to prefer encouraging
> the use of non-standard features rather than e.g. recognizing the include guard
> idiom and optimize away the subsequent #includes (as for instance g++ does).

I don't want to start a religion war about which compiler is better or
smarter or encourages a better style. I agree that recognizing the
include guard idiom is a good thing, probably the best thing to do for a
compiler.

Yet I'm stuck with MSVC anyway, as many other programmers out there, and
#pragma once may have a significant effect on compilation time on that
compiler. I just suggested a way to allow other compilers (there may be
fewer than I may think of, obviously) to use the #pragma and also to be
a little more descriptive. It's just a matter of a three line addition
in config/compiler/visualc.hpp:

#if _MSC_VER >= 1020
#define BOOST_HAS_PRAGMA_ONCE
#endif

for example also Metrowerks CodeWarrior supports #pragma once, so the
#define could also be added to config/compiler/metrowerks.hpp.

Cheers,

Alberto Barbati


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk