I can't seem to find an easy remove method in std.algorithm that takes an 
object and a range (an array in this case) and removes any matches from the 
range. I'm using this snippet for now:

private DrawingElement[] elements;

public override void Remove(DrawingElement d)
{
    foreach (i, child; elements)
    {
        if (child == d)
        {
            elements = remove(elements, i);
            break;
        }
    }
}

Ugly! :)

It's a direct port from some C# code so don't mind the silly variable names.

Reply via email to