Re: Avoiding Range Postblits

2015-02-18 Thread Ali Çehreli via Digitalmars-d-learn
On 02/18/2015 02:51 PM, "Nordlöw" wrote: > I'm guessing that move construction plays a key role here. move() does avoid the post-blit but you get many destructions in return: import std.stdio; import std.algorithm; import core.memory; struct Graph {} struct DW { int i; this(int i)

Re: Avoiding Range Postblits

2015-02-18 Thread ketmar via Digitalmars-d-learn
On Wed, 18 Feb 2015 22:51:17 +, Nordlöw wrote: > Can this be avoided somehow? i don't think so. you can use heap-allocated structs, of course, or maybe `RefCounted!` can do the trick, but i not tried it. signature.asc Description: PGP signature

Avoiding Range Postblits

2015-02-18 Thread Nordlöw
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 retur