|
Boost Users : |
From: Camilo La Rota (camilo.larota_at_[hidden])
Date: 2007-10-19 12:17:24
Hello Benoît,
I am not a BGL expert at all and I am not sure about what you want to do.
However, I will give you my humble opinion or advice, but it can be wrong...
I think that it is wrong to pass a pointer to structure type as a bundle
property template parameter and that it must be simply a structure.
Why do you do that ? There's something special that you want to do ?
Why don't you simply pass the structure type ?
( typedef boost::adjacency_list <vecS, vecS, undirectedS, NodeProperty,
EdgeProperty> BoostGraph_t;)
Camilo
Benoît Dagon wrote:
> Hi all,
>
> It's my first time submitting a question on a newsgroup so pardon me if I'm
> wrong in my way of doing.
>
> I have a graph of type BoostGraph_t defined like
>
> typedef boost::adjacency_list <vecS, vecS, undirectedS, NodeProperty*,
> EdgeProperty*> BoostGraph_t;
>
> with vertex and edge properties types defined as pointer on the following
> stuctures
>
> struct EdgeProperty {
> long m_id;
> double m_length;
> };
>
> struct NodeProperty {
> long m_id;
> };
>
> I'm now trying to use the dijkstra_shortest_paths() function with the edge
> length as parameter for the weigh_map function argument. But the call to the
> following function
>
> get(&EdgeProperty::m_length, m_graph);
>
> returns me the following errors
>
> ******
> e:\Boost\boost\graph\properties.hpp(337) : error C2825: 'Bundle::*': cannot
> form a qualified name
> e:\Boost\boost\graph\properties.hpp(337) : error C2226: syntax error :
> unexpected type 'Graph'
> e:\Boost\boost\graph\properties.hpp(337) : error C2334: unexpected token(s)
> preceding ':'; skipping apparent function body
> e:\Boost\boost\graph\properties.hpp(342) : error C2825: 'Bundle::*': cannot
> form a qualified name
> e:\Boost\boost\graph\properties.hpp(342) : error C2657: '`global namespace'::*'
> found at the start of a statement (did you forget to specify a type?)
> e:\Boost\boost\graph\properties.hpp(342) : error C2653: 'operator``global
> namespace''' : is not a class or namespace name
> e:\Boost\boost\graph\properties.hpp(342) : error C2501:
> 'boost::bundle_property_map<Graph,Descriptor,Bundle,T>::pm' : missing
> storage-class or type specifiers
> with
> [ Graph=boost::adjacency_list<boost::vecS,boost::vecS,
> boost::undirectedS,NodeProperty *,EdgeProperty *>,
> Descriptor=boost::property_map<boost::adjacency_list<boost::vecS,
> boost::vecS,boost::undirectedS,NodeProperty *,EdgeProperty *>,
> double EdgeProperty::* >::descriptor,
> Bundle=boost::property_map<boost::adjacency_list<boost::vecS,
> boost::vecS,boost::undirectedS,NodeProperty *,EdgeProperty *>,
> double EdgeProperty::* >::actual_bundle,
> T=double
> ]
> ******
>
> I know it's working correctly if I use NodeProperty and EdgeProperty for graph
> template arguments instead of pointers. But I would like to know if it's
> possible to do it in that way and how would be the correct syntax for the get()
> to work properly.
>
> Many thanks in advance for your help!
> ~Benoît
>
> _______________________________________________
> 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