Boost logo

Boost Users :

From: Jens Müller (jens.mueller_at_[hidden])
Date: 2007-02-24 12:36:30


Jens Müller schrieb:
> Can I store an edge_descriptor of a predecessor edge as an
> internal/bundled property?
>
> I am currently doing this:
>
> struct EdgeProperties;
>
> struct VertexProperties
> {
> double x;
> double y;
> double weight;
> int dist;
> boost::graph_traits<
> boost::adjacency_list<boost::vecS, boost::vecS,
> boost::bidirectionalS, VertexProperties, EdgeProperties>
> >::edge_descriptor pred;
> int app_height;
> bool mark;
> };
>
> struct EdgeProperties
> {
> double length;
> };
>
> int main() {
> using namespace boost;
>
> typedef adjacency_list<vecS, vecS, bidirectionalS, VertexProperties,
> EdgeProperties> Graph;
> }
>
> This is legal, isn't need? Obviously the definition of EdgeProperties is
> not needed where it is first used.
>
> But is this the proper way to do it, or is there a more elegant way?

Ah - now that I see that code together: I could forward-declare the
struct VertexProperties and then use it in the type of pred ...

And with C++0x I'll be able to put all that inside a function body ...


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