|
Boost : |
Subject: Re: [boost] Proposal for #pragma once support
From: Scott McMurray (me22.ca+boost_at_[hidden])
Date: 2009-06-09 22:58:55
2009/6/9 Christopher Jefferson <chris_at_[hidden]>:
>
> One thing to watch out for, in case you don't notice in advance: Some
> headers should NOT have #pragma once. Not very many, but such files exist.
> You'll probably want to try to find some way of guessing if a file already
> has a standard include guard (shouldn't be too hard to detect), and only
> #pragma once such files.
>
Which is exactly what GCC does to not need #pragma once =)
(And that check can be made fast by allowing the pathological cases to
fall back to the normal include guard behaviour, as that's still safe,
whereas #pragma once always has to go the slow route of canonizing all
the paths -- which isn't even always possible -- to be safe.)
~ Scott
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk