Bug 16331 – std.container.array constructor shouldn't check result of emplacement

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-07-28T15:19:00Z
Last change time
2016-10-01T11:46:17Z
Assigned to
nobody
Creator
greensunny12

Comments

Comment #0 by greensunny12 — 2016-07-28T15:19:02Z
Comparing the object after emplacement might fail if they aren't equal, a short example: 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 }
Comment #1 by github-bugzilla — 2016-07-28T17:02:58Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/539d860380edea250df7eb353174e58d8ef5f2cd Fix issue 16331 - std.container.array should allow uncomparable values https://github.com/dlang/phobos/commit/6db08d3dadb007d930a4042a6140ca4fb22ea540 Merge pull request #4673 from wilzbach/fix_16331 Fix issue 16331 - std.container.array should allow uncomparable values
Comment #2 by github-bugzilla — 2016-10-01T11:46:17Z
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/539d860380edea250df7eb353174e58d8ef5f2cd Fix issue 16331 - std.container.array should allow uncomparable values https://github.com/dlang/phobos/commit/6db08d3dadb007d930a4042a6140ca4fb22ea540 Merge pull request #4673 from wilzbach/fix_16331