Bug 11978 – std.algorithm canFind uses "value" where it means "needle"

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-23T08:05:00Z
Last change time
2014-04-22T20:39:18Z
Keywords
pull
Assigned to
andrej.mitrovich
Creator
regan

Comments

Comment #0 by regan — 2014-01-23T08:05:44Z
from std.algorithm: bool canFind(alias pred = "a == b", R, E)(R haystack, E needle) if (is(typeof(find!pred(haystack, needle)))); Returns true if and only if **value** can be found in range. Performs Ο(needle.length) evaluations of pred. What is **value** shouldn't that be needle?
Comment #1 by monarchdodra — 2014-01-23T10:34:00Z
Yes, doc is bad. Care to fix it?
Comment #2 by andrej.mitrovich — 2014-04-22T20:13:07Z
I wish the new ddoc parameter check feature found this. I've found a bunch more of these wrongly documented sections.
Comment #3 by github-bugzilla — 2014-04-22T20:39:18Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/d4b0e70c67b4031bd0dd3f167a7ecfb29e305175 Fix Issue 11978 - Fix typos in std.algorithm documentation referencing parameter names. https://github.com/D-Programming-Language/phobos/commit/dba14a1edb9bead15d5a2ecedccd6944767a92a8 Merge pull request #2101 from AndrejMitrovic/Fix11978 Fix Issue 11978 - Fix typos in std.algorithm documentation referencing p...