|
Boost : |
Subject: Re: [boost] "boost cold shoulder" (was proposal for #pragmaoncesupport)
From: Sid Sacek (ssacek_at_[hidden])
Date: 2009-06-11 13:08:10
-----Original Message-----
From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]] On Behalf Of Scott McMurray
Sent: Wednesday, June 10, 2009 12:03 PM
To: boost_at_[hidden]
Subject: Re: [boost] "boost cold shoulder" (was proposal for #pragmaoncesupport)
> Your forgetting about the natural impulse to not want to clutter the
> code with unnecessary workarounds. Make no mistake, that's all it is,
> since #pragma once is the wrong feature to add to a compiler if you
> want to speed up header inclusion.
>
> It might be acceptable in proprietary code that never moves outside of
> Windows, but since Boost will still have to have normal include
> guards, #pragma once is just noise, semantically.
I agree with you about "noise". Then again, there is noise, and then, there is "NOISE".
This might be noise:
#pragma once
But this really is NOISE
#ifndef SOME_BLAH_BLAH_BLAH
#define SOME_BLAH_BLAH_BLAH
...
#endif
What I ideologically want to see is this compromise between the two
#pragma once( SOME_BLAH_BLAH_BLAH )
I think you can figure out what that means in compiler terms. But since that is not possible at this point in time, a compromise should be made; one that respects both Microsoft compiler users, and the non-Microsoft compiler users. I don't believe that Microsoft has the only compiler that improves its compile-times using #pragma once. So other compilers can also benefit from the #pragma usage as well. My personal experience with large projects is that #pragma once cuts the build time by 26%. Every little bit counts when you're working on very large applications.
-Sid
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk