Removing an element from SList

Jesse Phillips jessekphillips+D at gmail.com
Sat May 14 09:00:00 PDT 2011


So I'm lost on why it is so hard to get an element removed from an SList:

test.d(7): Error: function std.container.SList!(string).SList.linearRemove (Range r) is not callable using argument types (string[])
test.d(7): Error: cannot implicitly convert expression (takeOne(["elements"])) of type string[] to Take!(Range)
test.d(8): Error: function std.container.SList!(string).SList.linearRemove (Range r) is not callable using argument types (string[])
test.d(8): Error: cannot implicitly convert expression (["elements"]) of type string[] to Take!(Range)

import std.container;
import std.range;

void main() {
    auto list = ["My", "elements"];
    auto slist = SList!(string)(list);
    slist.linearRemove(takeOne(["elements"]));
    slist.linearRemove(["elements"]);
}

I even tried to follow the pattern used within the unittests, but I still get a string[] out of take.


More information about the Digitalmars-d-learn mailing list