Skip to content

Commit

Permalink
Fix issue 16331 - std.container.array should allow uncomparable values
Browse files Browse the repository at this point in the history
  • Loading branch information
wilzbach committed Jul 28, 2016
1 parent 77bee52 commit 539d860
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion std/container/array.d
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,6 @@ Constructor taking a number of items
foreach (i, e; values)
{
emplace(p + i, e);
assert(p[i] == e);
}
_data = Data(p[0 .. values.length]);
}
Expand Down Expand Up @@ -2235,3 +2234,10 @@ unittest
assert(slice.moveBack == true);
assert(slice.moveAt(1) == true);
}

// issue 16331 - uncomparable values are valid values for an array
unittest
{
double[] values = [double.nan, double.nan];
auto arr = Array!double(values);
}

0 comments on commit 539d860

Please sign in to comment.