[Issue 13254] Cannot instantiate std.container.Array with immutables as T

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Aug 6 12:12:55 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13254

Phil Lavoie <maidenphil at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|Windows                     |All

--- Comment #1 from Phil Lavoie <maidenphil at hotmail.com> ---
(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.

--


More information about the Digitalmars-d-bugs mailing list