Boost logo

Boost :

Subject: Re: [boost] Proposal for #pragma once support
From: Zachary Turner (divisortheory_at_[hidden])
Date: 2009-06-09 15:08:03


On Tue, Jun 9, 2009 at 2:00 PM, Emil Dotchevski <emildotchevski_at_[hidden]>wrote:

> On Tue, Jun 9, 2009 at 11:19 AM, Zachary Turner <divisortheory_at_[hidden]>
> wrote:
> > #if defined(_MSC_VER) && (_MSC_VER >= 1020)
> > #pragma once
> > #endif
> >
> > That's all it takes. Everybody benefits.
>
> I'm sorry but what problem are we trying to solve with this? Does
> compiling Boost take too much time? If the answer is yes, is #pragrma
> once the best solution we can come up with? :)
>

It's not necessarily the "best" solution one can come up with, it's just one
of many solutions that all address the problem of compilation time from a
different angle. If we can come up with other solutions that's obviously
great, but I don't see any reason to ignore one solution that can then be
stacked with other solutions for even greater benefits. No matter how many
other solutions are implemented to reduce compilation time, #pragma once
will _always_ expand on that by reducing compilation times even further for
certain compilers.

That being said, compilation of boost itself isn't even the real use case,
since a user of boost typically just compiles it once and is done. The real
use case is for people using boost in their own projects, i.e. including
lots of boost header files at various locations in their program. In this
case, it has potential to make a huge impact, since developers frequently
build code tens of times per day. Even the slightest change to a header
file and a rebuild of the project to test the change has the potential to
trigger a rebuild of numerous other files, so there's no reason not to take
every measure possible to reduce compilation time.


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