Skip to content

Commit 539d860

Browse files
committed
Fix issue 16331 - std.container.array should allow uncomparable values
1 parent 77bee52 commit 539d860

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

std/container/array.d

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,6 @@ Constructor taking a number of items
431431
foreach (i, e; values)
432432
{
433433
emplace(p + i, e);
434-
assert(p[i] == e);
435434
}
436435
_data = Data(p[0 .. values.length]);
437436
}
@@ -2235,3 +2234,10 @@ unittest
22352234
assert(slice.moveBack == true);
22362235
assert(slice.moveAt(1) == true);
22372236
}
2237+
2238+
// issue 16331 - uncomparable values are valid values for an array
2239+
unittest
2240+
{
2241+
double[] values = [double.nan, double.nan];
2242+
auto arr = Array!double(values);
2243+
}

0 commit comments

Comments
 (0)