Thank you, that helps big time.

This is just more curiosity, but do you happen to know why I have to use DList.linearRemove() instead of DList.remove()?

import std.stdio;
import std.container.dlist;
import std.algorithm;
import std.range;

void main()
{
    auto list = make!DList("the", "quick", "brown", "fox");
    auto range = list[].find("quick").take(1);
    list.remove(range);
    list[].each!writeln; // the brown fox
}

This results in a compiler issue:

onlineapp.d(10): Error: function std.container.dlist.Container!string.DList.remove(Range r) is not callable using argument types (Take!(Range)) onlineapp.d(10): cannot pass argument range of type Take!(Range) to parameter Range r

Changing "remove" to "linearRemove" fixes it, but both the remove and linearRemove functions take a Range object, and linearRemove seems to just be a pass through to remove.

Reply via email to