Boost C++ Libraries: Ticket #7308: Property maps from bundled properties (with base member) https://svn.boost.org/trac10/ticket/7308 <p> In boost 1.50.0 the creation of property maps from a base member in bundled properties worked. After the modifications on bundled properties in boost 1.51.0 the code below fails compilation (gcc 4.7.1). </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&quot;boost/graph/adjacency_list.hpp&quot;</span><span class="cp"></span> <span class="k">struct</span> <span class="n">Base</span> <span class="p">{</span> <span class="kt">int</span> <span class="n">base_value</span><span class="p">;</span> <span class="p">};</span> <span class="k">struct</span> <span class="nl">Vertex</span> <span class="p">:</span> <span class="n">Base</span> <span class="p">{</span> <span class="kt">double</span> <span class="n">some_value</span><span class="p">;</span> <span class="p">};</span> <span class="kt">int</span> <span class="nf">main</span><span class="p">()</span> <span class="p">{</span> <span class="k">using</span> <span class="k">namespace</span> <span class="n">boost</span><span class="p">;</span> <span class="c1">// graph with bundled vertex property</span> <span class="n">adjacency_list</span><span class="o">&lt;</span> <span class="n">vecS</span><span class="p">,</span> <span class="n">vecS</span><span class="p">,</span> <span class="n">directedS</span><span class="p">,</span> <span class="n">Vertex</span> <span class="o">&gt;</span> <span class="n">graph</span><span class="p">(</span><span class="mi">1</span><span class="p">);</span> <span class="c1">// accessing members, works as expected</span> <span class="n">graph</span><span class="p">[</span> <span class="o">*</span><span class="n">vertices</span><span class="p">(</span><span class="n">graph</span><span class="p">).</span><span class="n">first</span> <span class="p">].</span><span class="n">some_value</span> <span class="o">=</span> <span class="mf">3.14</span><span class="p">;</span> <span class="n">graph</span><span class="p">[</span> <span class="o">*</span><span class="n">vertices</span><span class="p">(</span><span class="n">graph</span><span class="p">).</span><span class="n">first</span> <span class="p">].</span><span class="n">base_value</span> <span class="o">=</span> <span class="mi">42</span><span class="p">;</span> <span class="c1">// property maps from bundled properties</span> <span class="n">get</span><span class="p">(</span> <span class="o">&amp;</span><span class="n">Vertex</span><span class="o">::</span><span class="n">some_value</span><span class="p">,</span> <span class="n">graph</span> <span class="p">);</span> <span class="c1">// works as expected</span> <span class="n">get</span><span class="p">(</span> <span class="o">&amp;</span><span class="n">Vertex</span><span class="o">::</span><span class="n">base_value</span><span class="p">,</span> <span class="n">graph</span> <span class="p">);</span> <span class="c1">// works with 1.50.0, fails with 1.51.0</span> <span class="p">}</span> </pre></div></div><p> The issue is also present for the PBGL. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7308 Trac 1.4.3 bgrube@… Tue, 11 Sep 2012 17:56:40 GMT cc set https://svn.boost.org/trac10/ticket/7308#comment:1 https://svn.boost.org/trac10/ticket/7308#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">bgrube@…</span> added </li> </ul> <p> Probably related: Code like </p> <pre class="wiki">#include &lt;boost/graph/adjacency_list.hpp&gt; using namespace boost; typedef property&lt;vertex_bundle_t, int&gt; nodeProp; typedef adjacency_list&lt;vecS, vecS, bidirectionalS, nodeProp&gt; graphType; graphType graph; // gives compiler error with 1.51.0 </pre><p> compiles with Boost 1.50.0 but does not with 1.51.0 (using clang 3.1). </p> Ticket Jeremiah Willcock Wed, 12 Sep 2012 11:58:46 GMT <link>https://svn.boost.org/trac10/ticket/7308#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7308#comment:2</guid> <description> <p> Creating a property named <code>vertex_bundle</code> will confuse the compiler, since there is a built-in property in <code>adjacency_list</code> by that name already. The original code will take a bit more work to fix. As a workaround, could you try putting in an explicit cast to <code>int Vertex::*</code> on <code>&amp;Vertex::base_value</code>? That worked for me. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Jeremiah Willcock</dc:creator> <pubDate>Wed, 12 Sep 2012 12:24:06 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7308#comment:3 https://svn.boost.org/trac10/ticket/7308#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/80505" title="Allowed pointers-to-base-members to be used to access properties of ...">[80505]</a>) Allowed pointers-to-base-members to be used to access properties of derived bundled property classes; fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/7308" title="#7308: Bugs: Property maps from bundled properties (with base member) (closed: fixed)">#7308</a> </p> Ticket anonymous Mon, 01 Apr 2013 12:28:07 GMT <link>https://svn.boost.org/trac10/ticket/7308#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7308#comment:4</guid> <description> <p> Two lawmakers have filed <a class="ext-link" href="http://www.tokyobags.net/"><span class="icon">​</span>fake handbags</a> bills to legalize the half-gallon jugs, but a group of beer distributors is fighting both measures and appears to have helped <a class="ext-link" href="http://www.tokyobags.net/damier-ebene-canvas-c-53_58.html"><span class="icon">​</span>cheap louis vuitton damier ebene canvas</a> effectively kill both for the year. The half-gallon size growlers are an industry standard and are sold at <a class="ext-link" href="http://www.inlouboutin.org.uk/"><span class="icon">​</span>christian louboutin outlet</a> breweries around the country. </p> </description> <category>Ticket</category> </item> </channel> </rss>