Keep existingEdge – discard newEdge.
1 auto g1 = Graph!(int, int)([1, 2]); 2 alias CS = g1.ConflictStrategy; 3 4 g1 ~= g1.edge(1, 2, 1); 5 6 auto addedEdge = g1.add!(CS.keep)(g1.edge(1, 2, 2)); 7 8 assert(addedEdge.weight == 1);
See Implementation
Keep existingEdge – discard newEdge.