Subject: Re: [boost] Mixed use of "include" directives with quoted vs. angle-bracketed params, causing havoc
From: Michael Fawcett (michael.fawcett_at_[hidden])
Date: 2008-09-07 20:55:03
On Sun, Sep 7, 2008 at 2:21 PM, Rene Rivera <grafikrobot_at_[hidden]> wrote:
> In the case of my use case I needed a way to remove "searching relative to
> the including file directory" aspect of ("") includes. This is because the
> library includes headers as (include "a.h") which *never* gets around to
> searching extra include paths I specify because it always finds the one in
> the including dir first.
Ah, now I see the problem. I misunderstood.
> You misunderstood. Specifying the search paths works. But removing the local
> including dir from the search path is impossible.
> That would be because AFAIK all Boost headers start with "boost/..." and
> don't reference local includes. But moving to preferring ("") will likely
> encourage library authors to rely on what is essentially non-portable
> compiler behavior. The use of (<>) includes is technically also non-portable
> but is currently universally portable or can be made that way.
So it sounds like libraries should prefer <>, and the only time ""
should be used is in project specific headers (i.e. won't be reused).
But then often times project specific code ends up being generalized
into a library at a later date, at which point it should be <>, so
shouldn't you just always use <> then?