On 4/2/12, Justin Whear <jus...@economicmodeling.com> wrote:
> Classic singly-linked lists must be iterated to determine length, so use
> std.range.walkLength on it.

Specifically call it on its range. You can get a range by slicing the
slist, e.g.:

import std.range;
import std.container;

void main()
{
    auto s = SList!int(1, 2, 5, 10);
    assert(walkLength(s[]) == 4);
}

Reply via email to