Bug 3087 – std.range.retro.opIndex out of range

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-06-22T23:51:00Z
Last change time
2015-06-09T01:27:59Z
Keywords
wrong-code
Assigned to
andrei
Creator
samhu.samhu

Comments

Comment #0 by samhu.samhu — 2009-06-22T23:51:05Z
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) ?
Comment #1 by andrei — 2009-08-27T23:40:51Z
Correct, thanks!