Boost logo

Boost :

Subject: [boost] [graph] porting code from 1.46 to 1.54
From: Maurizio Vitale (mrz.vtl_at_[hidden])
Date: 2013-10-07 19:04:41


Hello boost,

  I'm trying to move some large code base to use boost 1.54.

In some dark corner of it, the following was compiling fine:

class Instance;

typedef boost::setS OutEdgeList;
typedef boost::listS VertexList;

struct InstancePropertyTag {
    typedef boost::vertex_property_tag kind;
};

typedef boost::property<InstancePropertyTag, Instance*> InstanceProperty;
typedef boost::adjacency_list<OutEdgeList, VertexList,
boost::bidirectionalS, InstanceProperty> Graph;
typedef boost::property_map<Graph, boost::vertex_index_t>::type IndexGraph;

under 1.54, I get 'attempt to form reference to void', but everything was
fine under 1.46.

I traced it a bit through template expansion, and the problem seems to be
that the type for vertex_index_t is not found.
The following declaration for InstanceProperty fixes (or hides) the problem:

typedef boost::property<InstancePropertyTag, Instance*,
boost::property<boost::vertex_index_t, int> > InstanceProperty;

Does somebody know if some properties were added by default to graphs
before and need to be explicitly added now?
I don't find anything in the documentation and all examples I've found seem
to imply that one wouldn't need to explicitly
add a property declaration of vertex_index_t.

Thanks a lot,

  Maurizio


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk