In the last line "graph.edge{x,y,w}" it says typename is not allowed?
I have used nested class edge and pushing vertices and their weight in elist vector which is of type edge.
Please help!!
In the last line "graph.edge{x,y,w}" it says typename is not allowed?
It is referring to the word "edge" after the member access operator . (dot)
Member access operators only allow data members, member functions, and enumerators on the right. Type names are not allowed.
(the standardese for this is "If E2 is a nested type, the expression E1.E2 is ill-formed" in § 5.2.5[expr.ref]/4)
Now if you replace that with Graph::edge, which names a type, it will compile