Bug in std.range.retro?

Sam Hu samhudotsamhu at gmail.com
Mon Jun 22 17:40:10 PDT 2009


Originally I posted in learn:

http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=16913

Move here to double confirm whether it is a bug:
static if (isRandomAccessRange!(R) && hasLength!(R))
        ref ElementType!(R) opIndex(uint n)
        {
            return _input[_input.length - n + 1];
        }

Shouldn't it be _input.length-(n+1) ?

Regards,
Sam



More information about the Digitalmars-d mailing list