Boost C++ Libraries: Ticket #12555: Graph headers are not self-contained https://svn.boost.org/trac10/ticket/12555 <p> Many BGL header files are not self-contained, meaning that they will not compile if <code>#include</code>d into a translation unit that doesn't <code>#include</code> anything else. For example, <code>boost/graph/bandwidth.hpp</code> refers to <code>vertex_index</code>, but does not <code>#include boost/graph/properties.hpp</code>, the header which declares <code>vertex_index</code>. </p> <p> Among other things, this prevents BGL from being adapted to take advantage of C++ modules (see <a class="ext-link" href="http://clang.llvm.org/docs/Modules.html"><span class="icon">​</span>http://clang.llvm.org/docs/Modules.html</a>), because modules require headers to be self-contained. </p> <p> Attached is a patch (against 1.60.0) to correct these problems, usually by adding missing <code>#include</code>s. The change to <code>howard_cycle_ratio.hpp</code> is slightly more subtle: the problem there is that the code refers to <code>boost::num_edges(g)</code>, but doesn't <code>#include</code> a header that declares that function. However, the choice of the right header to <code>#include</code> depends on the type <code>Graph</code> of <code>g</code>, which is a template parameter. This points to the real problem: this code should be calling <code>num_edges(g)</code> unqualified, so that it uses argument-dependent lookup to find the <code>num_edges()</code> overload in the namespace of <code>Graph</code>, rather than restricting itself to the overloads defined in namespace <code>boost</code>. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12555 Trac 1.4.3 gromer@… Wed, 26 Oct 2016 21:46:55 GMT attachment set https://svn.boost.org/trac10/ticket/12555 https://svn.boost.org/trac10/ticket/12555 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-graph.patch</span> </li> </ul> <p> Patch to fix isue </p> Ticket gromer@… Wed, 26 Oct 2016 22:07:13 GMT attachment set https://svn.boost.org/trac10/ticket/12555 https://svn.boost.org/trac10/ticket/12555 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-graph.2.patch</span> </li> </ul> <p> Corrected patch </p> Ticket anonymous Wed, 26 Oct 2016 22:08:28 GMT <link>https://svn.boost.org/trac10/ticket/12555#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12555#comment:1</guid> <description> <p> Apologies, I made a mistake in generating the initial patch; please use <code>boost-graph.2.patch</code> instead. </p> </description> <category>Ticket</category> </item> </channel> </rss>