www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16331] New: std.container.array constructor shouldn't check


          Issue ID: 16331
           Summary: std.container.array constructor shouldn't check result
                    of emplacement
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: greensunny12 gmail.com

Comparing the object after emplacement might fail if they aren't equal, a short

void main()
    double[] values = [double.nan, double.nan];

    import std.container.array : Array;
    auto arr = Array!double(values); //
core.exception.AssertError std/container/array.d(381): Assertion failure

Jul 28 2016