Skip to content

Instantly share code, notes, and snippets.

@pycckuu
Created March 31, 2016 03:45
Show Gist options
  • Save pycckuu/c21319629e5bf450f889245bf94eade2 to your computer and use it in GitHub Desktop.
Save pycckuu/c21319629e5bf450f889245bf94eade2 to your computer and use it in GitHub Desktop.
method const vs non-const
friend void get_edge_value(const Graph &g, int node_x, int node_y){
if (g.mapping[node_x][node_y]==1) {
list<Edge>::iterator it;
for (it = g.list_of_edges.begin(); it != g.list_of_edges.end(); it++) {
if ( (it->begin == node_y && it->end == node_x) || (it->begin == node_x && it->end == node_y)){
cout << it->distance;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment