Subject: [Boost-bugs] [Boost C++ Libraries] #12555: Graph headers are not self-contained
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-10-26 21:45:17
#12555: Graph headers are not self-contained
------------------------------+----------------------
Reporter: gromer@⦠| Owner: jewillco
Type: Bugs | Status: new
Milestone: To Be Determined | Component: graph
Version: Boost 1.60.0 | Severity: Problem
Keywords: |
------------------------------+----------------------
Many BGL header files are not self-contained, meaning that they will not
compile if `#include`d into a translation unit that doesn't `#include`
anything else. For example, `boost/graph/bandwidth.hpp` refers to
`vertex_index`, but does not `#include boost/graph/properties.hpp`, the
header which declares `vertex_index`.
Among other things, this prevents BGL from being adapted to take advantage
of C++ modules (see http://clang.llvm.org/docs/Modules.html), because
modules require headers to be self-contained.
Attached is a patch (against 1.60.0) to correct these problems, usually by
adding missing `#include`s. The change to `howard_cycle_ratio.hpp` is
slightly more subtle: the problem there is that the code refers to
`boost::num_edges(g)`, but doesn't `#include` a header that declares that
function. However, the choice of the right header to `#include` depends on
the type `Graph` of `g`, which is a template parameter. This points to the
real problem: this code should be calling `num_edges(g)` unqualified, so
that it uses argument-dependent lookup to find the `num_edges()` overload
in the namespace of `Graph`, rather than restricting itself to the
overloads defined in namespace `boost`.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12555> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC