Bug 5910 – Stride members' documentation comments are wrong

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-04-29T21:39:00Z
Last change time
2012-01-04T07:28:39Z
Assigned to
andrei
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2011-04-29T21:39:22Z
It seems the following std.range Stride members have the exact same comments as Retro. I guess it was a case of copy & paste, and its reflected in the online documentation: opIndex(size_t n); Forwards to input[input.length - n + 1]. Defined only if R is a random access range and if R defines R.length. void opIndexAssign(ElementType!(R) val, size_t n); Forwards to input[input.length - n + 1]. Defined only if R is a random access range and if R defines R.length. ElementType!(R) moveAt(size_t index); Forwards to input[input.length - n + 1]. Defined only if R is a random access range and if R defines R.length. typeof(this) opSlice(size_t a, size_t b); Forwards to input[input.length - n + 1]. Defined only if R is a random access range and if R defines R.length. --------------- These are all wrong. The first one should be: ''' opIndex(size_t n); Forwards to input[n * n]. Defined only if R is a random access range and if R defines R.length. ''' and the rest need to be updated based on the implementation. (I think all of these should be replaced with "input[n * n]")
Comment #1 by kennytm — 2011-04-30T03:50:23Z
Better not conflate the two "n"s :) opIndex(size_t i); Forwards to input[i * n]. (etc.)
Comment #2 by andrej.mitrovich — 2011-04-30T06:50:37Z
Oh right, it's _n * n in the code. I think a better name for "_n" is 'step'.
Comment #3 by andrej.mitrovich — 2012-01-04T07:28:39Z
Stride is gone and was replaced with an auto return function 'stride'. All of that documentation is gone now.