1. copy's prototype is:
Range2 copy(Range1, Range2)(Range1 source, Range2 target);
It would be more self-documenting written as:
OutputRange copy(InputRange, OutputRange)(InputRange source, OutputRange target);
In general, for all the algorithms that deal with ranges, the range types should be named after the type of range expected - ForwardRange, InputRange, BidirectionalRange, etc.
2. map has inconsistent use of element names - calling it x in the description and e in the example code. Should use the same name in each. Check other descriptions for similar issues.
3. joiner should include a "See Also" link to the very similar std.range.chain
Comment #1 by bearophile_hugs — 2014-11-10T09:22:10Z
(In reply to Walter Bright from comment #0)
> In general, for all the algorithms that deal with ranges, the range types
> should be named after the type of range expected - ForwardRange, InputRange,
> BidirectionalRange, etc.
It's even conceivable for the compiler to enforce this wise rule.
Comment #2 by github-bugzilla — 2014-11-11T22:30:38Z
Now that sig constraints are included in ddoc's output, is (1) still an issue? The declaration of std.algorithm.copy is now:
Range2 copy(Range1, Range2)(Range1 source, Range2 target) if (isInputRange!Range1 && isOutputRange!(Range2, ElementType!Range1));
(2) and (3) have been addressed by the PR that merged.
Comment #4 by github-bugzilla — 2015-02-18T03:39:43Z
Comment #5 by alexandru.razvan.c — 2016-10-30T18:46:40Z
https://github.com/dlang/phobos/pull/4883
Regarding (1), since this bug was created the file hierarchy seems to have changed. I updated the files from std/algorithm as explained in the original post. Awaiting feedback.
Comment #6 by alexandru.razvan.c — 2016-10-30T18:48:16Z
https://github.com/dlang/phobos/pull/4883
Regarding (1), since this bug was created the file hierarchy seems to have changed. I updated the files from std/algorithm as explained in the original post. Awaiting feedback.
Comment #7 by github-bugzilla — 2016-11-01T22:23:38Z