Boost logo

Boost :

Subject: Re: [boost] New dependency report
From: Peter Dimov (lists_at_[hidden])
Date: 2014-06-05 10:40:02


Andrey Semashev wrote:
> On Thu, Jun 5, 2014 at 5:37 PM, Antony Polukhin <antoshkka_at_[hidden]>
> wrote:
> >
> > Would it be good to move a single <boost/functional/hash/hash_fwd.hpp>
> > header into the Boost.Core?
> > This header depends only on Boost.Config. It adds dependency to a whole
> > Boost.Functional library for the following libraries: array, container,
> > filesystem, multiindex, thread, type_index, variant.
>
> Hmm, although I can see benefits of it, I don't like tearing forward
> declarations from definitions.

I don't think it should go Core.

On the other hand, the whole purpose of forward declarations is to let you
not depend on the definition. This is still valuable when the _fwd header is
in the same module, as it decreases the actual dependencies in terms of
headers included, but this decrease doesn't show up in a module dependency
report. Neither will it affect a module-based automatic downloader.

Therefore, it might be worth thinking about a separate module that hosts
just forward declarations.

The danger of declarations and definitions going out of sync can be avoided
by having tests (in the 'forward' module) that include both the declaration
and the actual definition.

Incidentally, 'functional/hash' has always bothered me. What was wrong with
just 'hash'? Hierarchies do have its place but hash is hash, nothing
particularly functional about it.


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