Graph.indexOf

Returns the ndex of node n in the list of nodes.

struct Graph(Node, Weight = void, Flag!"isDirected" isDirected = No.isDirected, EdgePayload = void)
size_t
indexOf
const
(
Node n
)

Examples

1 auto g1 = Graph!(int, int)([1, 2]);
2 
3 assert(g1.indexOf(1) == 0);
4 assert(g1.indexOf(2) == 1);
5 assertThrown!MissingNodeException(g1.indexOf(3));

Meta