Modify

Ticket #7308 (closed Bugs: fixed)

Opened 20 months ago

Last modified 13 months ago

Property maps from bundled properties (with base member)

Reported by: andreas.zilian@… Owned by: jewillco
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.

Attachments

Change History

comment:1 Changed 20 months ago by bgrube@…

  • 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 Changed 20 months ago by jewillco

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 Changed 20 months ago by jewillco

  • Status changed from new to closed
  • Resolution set to fixed

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

comment:4 Changed 13 months ago by anonymous

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.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.