|
Boost Users : |
From: Elvanör (elvanor2004_at_[hidden])
Date: 2005-03-16 20:10:40
Since nobody answered my first question, I had to look up myself on the
code and found some kind of answer (at least, it works for me).
I just use, if I have a graph of type Graph (it is in fact an adjacency
list, but that is unimportant),
typedef typename Graph:vertex_bundled VertexType;
But I am still wondering if it is the "correct solution". For me it
works, however I don't understand why I use directly
Graph:vertex_bundled and not some kind of
graph_traits<Graph>::vertex_bundled thing...
I am new to traits (be it for STL iterators or Boost Graphs ) and don't
understand how it works internally (I just understand the basic concept
yet, and know how to use them). What is the whole purpose of having a
graph_traits class if something as simple as Graph:vertex_bundled
works? Why am I doing things like
graph_traits<Graph>::vertex_descriptor instead of just
Graph::vertex_descriptor then ??
Any help would be appreciated, and I still think the documentation
should mention how to get the type of the bundled properties.
Jean-Noël Rivasseau
> Hello,
>
> How can I get the type of my vertex properties if I use bundled
> properties as internal properties?
>
> My example is this one:
>
> typedef adjacency_list<mapS, vecS, undirectedS, myClass> Graph;
>
> // and in one function:
>
> template <class graph>
>
> void myFunction (Graph & g)
> {
>
> // Here I need to declare an object of type myClass... how can I get
> this type using graph_traits ??
>
> }
>
> Thanks. Again, the documentation on bundled properties really need to
> be improved, IMHO. All the information I could find was relevant to
> the old property maps mechanism...
>
> Jean-Noël
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
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