Modify

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#7308 closed Bugs (fixed)

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 (0)

Change History (4)

comment:1 Changed 5 years 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 5 years 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 5 years ago by jewillco

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

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

comment:4 Changed 4 years 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.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain jewillco.
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.