key in aa.keys, but aa[key] give range violation?

Yuxuan Shui via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 29 17:26:49 PDT 2016


My code looks something like this:

bool[ulong][ulong] edge;
foreach(u; from)
     foreach(v; to_)
         edge[u][v] = true;
foreach(u; edge.keys) {
     auto adj = edge[u];
     //....
}

And sometimes edge[u] would give Range violation error.


More information about the Digitalmars-d-learn mailing list