Boost logo

Boost :

Subject: Re: [boost] Header Inclusion practices
From: Olaf van der Spek (ml_at_[hidden])
Date: 2017-04-12 07:09:42


On Tue, Apr 11, 2017 at 7:55 PM, Robert Ramey via Boost
<boost_at_[hidden]> wrote:
> a) use #include "header.hpp" for files in the same directory as the current
> source file.
>
> b) use #include "other directory/header.hpp" for files which are known to be
> in a specific place relative to the current file. This shows up in things
> like: #include "../include/header.hpp" for tests and examples.

I'm not sure about #include " " in library code.. especially not
#include "../ " as it breaks when you move the file.

> #include "../include/cpp.hpp"
> #include "../include/exception.hpp"
> #include "../include/safe_integer.hpp"
> #include "../include/safe_range.hpp"

This too breaks when you move the example / test .cpp.
The names are too generic as well, is a normal user supposed to do
#include <exception.hpp>? Your lib might not be the only one with an
exception.hpp file..

-- 
Olaf

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