Bug 13254 – Cannot instantiate std.container.Array with immutables or consts as T

Status
NEW
Severity
normal
Priority
P3
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2014-08-04T18:39:48Z
Last change time
2024-12-01T16:22:07Z
Assigned to
No Owner
Creator
Phil Lavoie
Moved to GitHub: phobos#10079 →

Comments

Comment #0 by maidenphil — 2014-08-04T18:39:48Z
Using dmd distribution 2.065. This does not compile: std.container.Array!(immutable(dchar)) array; Error: The error seems to be caused because Array.Payload uses destroy on an immutable type and that makes the compiler cry. I see that the code has been updated to support "elaborate destructors", but I don't think it will prevent the problem. Thx!
Comment #1 by maidenphil — 2014-08-06T19:12:55Z
(In reply to Phil Lavoie from comment #0) > Using dmd distribution 2.065. This does not compile: > > std.container.Array!(immutable(dchar)) array; > > Error: > > The error seems to be caused because Array.Payload uses destroy on an > immutable type and that makes the compiler cry. I see that the code has been > updated to support "elaborate destructors", but I don't think it will > prevent the problem. > > Thx! If a struct can have an elaborate destructor and be const/immutable at the same time, this seems like it will not compile.
Comment #2 by robert.schadek — 2024-12-01T16:22:07Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10079 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB