Remove element from DList

cal callumenator at gmail.com
Sat Oct 6 19:14:58 PDT 2012


On Sunday, 7 October 2012 at 01:14:48 UTC, Jonathan M Davis wrote:
> The correct way is to use find combined with take (which is 
> what you're doing,
> except that you're not using find). So, something like this 
> should work
>
> void main()
> {
>     auto list = DList!int([1,2,3,4]);
>     list.remove(find(list[], 3).take(1));
> }
>
>
> However, for some reason, this is indeed not working right now. 
> It's a bug.
> Please report it.

SList doesn't implement remove, so perhaps DList can only 
guarantee the required complexity when given the range defined in 
DList, and for other types of ranges, it can only guarantee 
linear complexity?


More information about the Digitalmars-d-learn mailing list