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're just concerned about readability you could do something like this:
typedef map AdjacencyList; struct adjacency { adjacency(AdjacencyList::iterator& it) : vertex(it->first), edge(it->second) {} Vertex& vertex; Edge& edge; };
And then:
Vertex v = adjacency(it).vertex;