Reference or Value Semantics for Graph Traversal Range

"Nordlöw" via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 18 06:20:02 PST 2015


On Wednesday, 18 February 2015 at 14:07:01 UTC, Steven 
Schveighoffer wrote:
> But once initialized, it DOES have reference semantics:
>
> string[int] x;
> x[0] = "zero";
> auto y = x;
> x[1] = "one";
> assert(x == y);

Ok, great! I always initialize distMap with firstNd in the 
DijkstraWalk.this so that avoids the problem then.

Thanks alot!


More information about the Digitalmars-d-learn mailing list