Isn't using find with retro awkward?

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed Feb 16 13:00:13 PST 2011


On 2/16/11, jam <gr0v3er+d at gmail.com> wrote:
> void main()
> {
>     auto a = [5,1,2,3,4,5,1];
>     auto index = countUntil(retro(a),5);
>     writeln(a[a.length-1-index .. a.length]);
> }
>

That works for random-access ranges.
But I was under the impression that bidirectional ranges don't
necessarily have a length property?


More information about the Digitalmars-d-learn mailing list