How to foreach over a DList?

Jos van Uden usenet at fwend.com
Mon Mar 31 14:57:41 PDT 2014


On 31-3-2014 19:50, Jeroen Bollen wrote:
> I am trying to foreach over a std.container.DList but it isn't working. I have tried the following code: https://gist.github.com/Binero/f30e56351baf05f1a2ec
>
> I am getting the following errors:
>
> /usr/include/dlang/dmd/std/container.d(1925): Error: template std.container.DList!ubyte.DList.insertBeforeNode cannot deduce function from argument types !()(typeof(null), int), candidates are:
> /usr/include/dlang/dmd/std/container.d(2096): std.container.DList!ubyte.DList.insertBeforeNode(Stuff)(Node* n, Stuff stuff) if (isInputRange!Stuff && isImplicitlyConvertible!(ElementType!Stuff, T))
> /usr/include/dlang/dmd/std/container.d(2155): std.container.DList!ubyte.DList.insertBeforeNode(Stuff)(Node* n, Stuff stuff) if (isImplicitlyConvertible!(Stuff, T))
> source/app.d(7): Error: template instance std.container.DList!ubyte.DList.insertBack!int error instantiating
> source/app.d(11): Error: invalid foreach aggregate list1

http://rosettacode.org/wiki/Strand_sort#D


More information about the Digitalmars-d-learn mailing list