DList!int.remove(range.takeOne) - workarounds?

Algo via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Oct 12 02:45:20 PDT 2014


DList seems to have an issue with remove:

void main()
{
     import std.container, std.range, std.algorithm;
     auto list = DList!int([1, 2, 4, 6]);
     auto res = find(list[], 2);
     list.remove(res); //ok
     /*
     list.remove(res.takeOne);
Error: function std.container.dlist.DList!int.DList.remove (Range 
r) is not callable using argument types (Result)
     list.remove(res.take(1));
Error: function std.container.dlist.DList!int.DList.remove (Range 
r) is not callable using argument types (Take!(Range))
     */
}

Are there any known workarounds besides linearRemove?


More information about the Digitalmars-d-learn mailing list