[BGL] problem about copy graph

typedef adjacency_list

Li Ning wrote:
typedef adjacency_list
graph_t; typedef graph_traits
::vertex_descriptor vertex_t; typedef graph_traits ::edge_descriptor edge_t; struct edge_ex { //int index; bw_t az_capacity; bw_t za_capacity; int cost; vertex_t fake_source; }; // init a graph g and assign edge_ex values, and get a std::pair
r when add_edge(5,6,g); graph_t g2 = g; std::pair rr = edge(5,6,g2); g2[rr.first].cost = 1000; std::cout<
//output is: old_value old_value 1000
WHY?? It seems a bug, g2[r.first] should be 1000 rather than the value assign to g even r.first is a descriptor that belongs to g OK, this is problematic usage, but... g2[r.first] works, it doesn't make sense.
Sorry, should be
std::cout<
participants (1)
-
Li Ning