Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#7308 closed Bugs (fixed)

Property maps from bundled properties (with base member)

Reported by: andreas.zilian@… Owned by: Jeremiah Willcock
Milestone: To Be Determined Component: graph
Version: Boost 1.51.0 Severity: Problem
Keywords: property map, bundled properties, base member Cc: bgrube@…

Description

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).

#include "boost/graph/adjacency_list.hpp"

struct Base          { int    base_value; };
struct Vertex : Base { double some_value; };

int main()
{
        using namespace boost;

        // graph with bundled vertex property
        adjacency_list< vecS, vecS, directedS, Vertex > graph(1);

        // accessing members, works as expected
        graph[ *vertices(graph).first ].some_value = 3.14;
        graph[ *vertices(graph).first ].base_value = 42;

        // property maps from bundled properties
        get( &Vertex::some_value, graph ); // works as expected
        get( &Vertex::base_value, graph ); // works with 1.50.0, fails with 1.51.0
}

The issue is also present for the PBGL.

Change History (4)

comment:1 by bgrube@…, 10 years ago

Cc: bgrube@… added

Probably related: Code like

#include <boost/graph/adjacency_list.hpp>

using namespace boost;

typedef property<vertex_bundle_t, int> nodeProp;
typedef adjacency_list<vecS, vecS, bidirectionalS, nodeProp> graphType;

graphType graph;  // gives compiler error with 1.51.0

compiles with Boost 1.50.0 but does not with 1.51.0 (using clang 3.1).

comment:2 by Jeremiah Willcock, 10 years ago

Creating a property named vertex_bundle will confuse the compiler, since there is a built-in property in adjacency_list 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 int Vertex::* on &Vertex::base_value? That worked for me.

comment:3 by Jeremiah Willcock, 10 years ago

Resolution: fixed
Status: newclosed

(In [80505]) Allowed pointers-to-base-members to be used to access properties of derived bundled property classes; fixes #7308

comment:4 by anonymous, 10 years ago

Two lawmakers have filed fake handbags bills to legalize the half-gallon jugs, but a group of beer distributors is fighting both measures and appears to have helped cheap louis vuitton damier ebene canvas effectively kill both for the year. The half-gallon size growlers are an industry standard and are sold at christian louboutin outlet breweries around the country.

Note: See TracTickets for help on using tickets.