Deprecating this(this)
ag0aep6g
anonymous at example.com
Sun Apr 1 14:34:01 UTC 2018
On Sunday, 1 April 2018 at 13:37:43 UTC, Jonathan M Davis wrote:
> One issue is that postblit constructors fundamentally don't
> work with const. The problem is that a postblit constructor
> works by copying the object and _then_ mutating it, and you
> can't mutate a const object.
I'm not so sure if that's fundamental. Can't we just say that the
copy is head-mutable at the time when the postblit function is
called, and it only becomes fully const after that?
The destination can't be const/immutable already, or you wouldn't
be able to write there anyway.
More information about the Digitalmars-d
mailing list