[BGL] add_vertex(vp, graph) with mix of internal & bundled properties
Hello, I need to use the overload of add_vertex that takes the vertex property object as a parameter. I am using a mix of internal and bundled properties because I had to add the vertex_index property but did not want to clutter my bundled property with an index field. How do I instantiate this mixed property object to call add_vertex(vp, graph)? For reference, my graph is defined like this: adjacency_list<vecS, listS, indirectedS, boost::property<boost::vertex_index_t, int, MyNodeProperties>, MyEdgeProperties> I basically want to do this call: add_vertex(myNodeProp, graph) but I am getting a compilation error that it is not a boost::property<....> type. How do I wrap my bundled property in an object that I can pass to this function? Thanks, Sara
On Aug 30, 2007, at 12:47 AM, Sara Ting wrote:
I need to use the overload of add_vertex that takes the vertex property object as a parameter. I am using a mix of internal and bundled properties because I had to add the vertex_index property but did not want to clutter my bundled property with an index field. How do I instantiate this mixed property object to call add_vertex(vp, graph)?
For reference, my graph is defined like this: adjacency_list<vecS, listS, indirectedS, boost::property<boost::vertex_index_t, int, MyNodeProperties>, MyEdgeProperties>
I basically want to do this call: add_vertex(myNodeProp, graph) but I am getting a compilation error that it is not a boost::property<....> type. How do I wrap my bundled property in an object that I can pass to this function?
I believe this will do it: add_vertex(boost::property<boost::vertex_index_t, int, MyNodeProperties>(num_vertices(graph), myNodeProp), graph); - Doug
participants (2)
-
Doug Gregor
-
Sara Ting