Is there any way to rename the first and second accessor functions of a map iterator. I understand they have these names because of the underlying pair which represents the
If you don't need the iterator (e.g., a range-based for loop suits your purpose), then as of c++17 you can use structured bindings:
map adjacency_list; for( auto & [ vertex, edge ] : adjacency_list ) { // do stuff with vertex }