Skip to content

Commit

Permalink
Merge pull request #4673 from wilzbach/fix_16331
Browse files Browse the repository at this point in the history
Fix issue 16331 - std.container.array should allow uncomparable values
  • Loading branch information
schveiguy authored Jul 28, 2016
2 parents 77bee52 + 539d860 commit 6db08d3
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 6db08d3

Please sign in to comment.