Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] bundled properties and forward declarations (changes from 1.42 -> 1.46.1 ?)
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2011-08-10 13:57:10


On Wed, 10 Aug 2011, Anders Wallin wrote:

> I have code using bundled properties roughly like this that compiles
> with boost 1.42:
> struct EdgeProperty;
> typedef adjacency_list< ... , EdgeProperty , ...> MyGraph;
> typedef graph_traits<MyGraph>::edge_descriptor Edge;
>
> struct EdgeProperty {
> Edge next;
> };
>
>
> When trying to compile this with boost 1.46.1 I get "error: forward
> declaration of EdgeProperty’". I am not sure why.
> The obvious solution would be to move the definition of EdgeProperty
> before the MyGraph typedef, but then I run into a circular
> dependency problem as I want to store an edge_descriptor in EdgeProperty.

Look at my answer to
<URL:http://stackoverflow.com/questions/4232409/how-to-solve-boostbgl-template-class-circular-dependency>;
it shows how to use bundled properties that contain vertices and edges
from the graph being created.

-- Jeremiah Willcock


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net