$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] [graph]
From: liquid (kj_at_[hidden])
Date: 2009-04-18 15:14:46
I'd like to have unique vertices in a graph based on index of type
std::string. I did the following coding.
typedef property<edge_weight_t,float> EProperty;
typedef property<vertex_index_t,string> VIndex;
typedef adjacency_list<setS,listS,directedS,VIndex,EProperty> Graph;
typedef property_map<Graph, vertex_index_t>::type VIndexMap;
graph_traits<Graph>::vertex_descriptor
addv(property_traits<VIndexMap>::value_type v,Graph &g)
{
graph_traits<Graph>::vertex_descriptor vd;
vd = add_vertex(VIndex(v),g);
return vd;
}
Does "add_vertex" check the existence of added vertices of given index?
No, it doesn't.
Or I do something wrong.
Regards
liquid