[Issue 9493] New: std.algorithm.canFind returns true for empty string in array of integers
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Feb 9 23:58:56 PST 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9493
Summary: std.algorithm.canFind returns true for empty string in
array of integers
Product: D
Version: D2
Platform: x86_64
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: monkeyworks12 at hotmail.com
--- Comment #0 from monkeyworks12 at hotmail.com 2013-02-09 23:58:48 PST ---
It seems that std.algorithm.canFind returns true when checking for the empty
string within an array of integers. This seems like unintended behaviour to me,
so I'm reporting it as a bug. This bug is present on at least DMD 2.061.
Example:
import std.algorithm;
void main()
{
//This assertion should fail, but doesn't
assert(canFind([1, 2, 3, 4], ""));
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list