Boost logo

Boost :

From: Vesa Karvonen (vesa.karvonen_at_[hidden])
Date: 2001-07-01 09:24:08

From: "David Abrahams" <david.abrahams_at_[hidden]>
> From: "Paul Baxter" <paul_baxter_at_[hidden]>

> > a) Section 1 - Perhaps add guideline about when to use #include
> > "myheader.hpp" instead of <myheader.hpp> Just to clarify system/library
> > headers vs user's headers.
> Actually I don't know what the rule should be. After working on the build
> system, I find that compilers have inconsistent (often configurable) rules
> about what they'll do for #include "..." vs #include <...>. The only thing
> that seems consistent is that #include "..." may search more places than
> #include <...> (e.g. the directory of the #including file).

Before observing that Boost uses <...>, I always reserved <...> for system and
standard headers (Boost is neither of those) and used "..." for user headers.

I have observed that the same convention is followed by many programmers (e.g.
Jaakko Järvi, Bjarne Stroustrup, John Lakos, John Barton, Lee Nackman, ...
just checking a couple of books on my desk), and those that do not follow the
standard, don't generally know the difference between <...> and "...". (FYI,
I'm not talking about David Abrahams, which I assume knows the clauses that
describe their behavior.)

I think that the reason why <...> is better suited for system and standard
headers is that "..." may result in looking at more places. I think that a
proper separation of <...> and "..." results in faster and safer header
look-up by the preprocessor:
- Faster because system & std headers are looked-up in only the <...> places.
- Faster because user headers are found after lookup in only the "..." places.
- Safer because a system|std header is not accidentally overridden by a user

Boost list run by bdawes at, gregod at, cpdaniel at, john at