[Issue 13629] Field postblit can't be generated for const field
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon Oct 20 15:24:45 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13629
Jonathan M Davis <issues.dlang at jmdavisProg.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |issues.dlang at jmdavisProg.co
| |m
--- Comment #3 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
As much as this sucks, it really isn't a bug. const and postblits are
incompatible by their very nature, because the postblit copies and then
mutates, which violates const. So, arguably, going with postblit constructors
over copy constructors was a mistake. There's a DIP that tries to fix the
problem ( http://wiki.dlang.org/DIP49 ), but it was deemed to be way too
complicated. This is a design problem in the language that needs to be fixed
(possibly by adding copy constructors) and not a bug in the compiler. It is
expected behavior at this point.
--
More information about the Digitalmars-d-bugs
mailing list