|
Boost : |
Subject: Re: [boost] Proposal for #pragma once support
From: Nevin \ (nevin_at_[hidden])
Date: 2009-06-11 14:40:15
2009/6/9 Zachary Turner <divisortheory_at_[hidden]>
> I would like to propose conditional support for #pragma once be added to
> all
> header files in boost. This would involve, at the beginning of every
> header
> file, a preprocessor check to determine whether or not the particular
> compiler is on a whitelist of known compilers to optimized #pragma once.
1. To make a case for using the non-portable #pragma once vs. portable
include guards, you'll have to come up with metrics comparing #pragma once
with include guards and show that #pragma once is significantly faster for
the compilers listed at <
http://www.boost.org/development/tests/release/developer/summary.html>.
2. When compilers get #pragma once wrong (as in <
http://gcc.gnu.org/ml/gcc-bugs/2009-01/msg03268.html> earlier this year),
who exactly is going to revert all of Boost back?
3. The semantics of #pragma once are different than the semantics of
include guards (I believer that #pragma once tends to use the OS notion of
identical files, and can fail under certain pathological cases). We would
still need include guards everywhere for correctness.
-- Nevin ":-)" Liber <mailto:nevin_at_[hidden]> (847) 691-1404
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk