Avoiding Range Postblits
"Nordlöw" via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Feb 18 14:51:17 PST 2015
At
https://github.com/nordlow/justd/blob/master/knet/association.d#L59
I'm constructing an array of ranges that are used further down in
the function contextOf.
The expression
nds.map!(nd => gr.dijkstraWalker(nd, ...)).array;
however triggers postblits for the range DijkstraWalker returned
by the instantiator dijkstraWalker.
Can this be avoided somehow?
I'm guessing that move construction plays a key role here.
Note that I can't remove the .array as they required to be
l-values because their iteration to have side-effects at the end
of the function contextOf().
More information about the Digitalmars-d-learn
mailing list