ConflictStrategy.sumWeights

Return an edge with sum of both weights. If given payload will be kept from existingEdge .

struct ConflictStrategy
static
static if(isWeighted)
sumWeights

Examples

auto g1 = Graph!(int, int)([1, 2]);
alias CS = g1.ConflictStrategy;

g1 ~= g1.edge(1, 2, 1);

auto addedEdge = g1.add!(CS.sumWeights)(g1.edge(1, 2, 1));

assert(addedEdge.weight == 2);

Meta