www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13468] New: std.algorithm.canFind(null) fails with class

https://issues.dlang.org/show_bug.cgi?id=13468

          Issue ID: 13468
           Summary: std.algorithm.canFind(null) fails with class
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: murphyslaw480 gmail.com

Created attachment 1427
  --> https://issues.dlang.org/attachment.cgi?id=1427&action=edit
test file, should segfault

I would like to check if any entries in an array of reference types are null.

If you call canFind(null) on an array of a user-defined class, it segfaults.
However, it seems to work with other reference types like string.

--
Sep 13 2014