Boost logo

Boost :

Subject: Re: [boost] [#pragma once]
From: Bo Persson (bop_at_[hidden])
Date: 2009-04-13 17:22:34


Sid Sacek wrote:
> [ Graham wrote: ]
>> Incredibuild (xoreax) and other parallel compilation systems have
> problems with pragma once
>
> I'm not sure what the "problems with pragma once" are by Graham's
> statement above.

> So far, I have heard that #pragma once doesn't work right on some
> platforms. That tells me the programmer cannot rely on it, but that
> doesn't indicate that it cannot be used in the program.
>
>
> #if defined( _MSC_VER ) && ( _MSC_VER >= 1020 )
> # pragma once
> #endif
>

The thing is that it works for "platforms" where _MSC_VER is 1020, or
somewhat higher than that. On platforms where _MSC_VER isn't defined,
or where its value is significally higher that 1020, the include
guards work just as well.

How much effort should we put into potentially optimizing compile time
for some ancient compilers?

Bo Persson


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