Discussion Thread: DIP 1040--Copying, Moving, and Forwarding--Community Review Round 1

Timon Gehr timon.gehr at gmx.ch
Fri Mar 12 23:52:00 UTC 2021


On 11.03.21 23:39, Walter Bright wrote:
> On 3/11/2021 10:43 AM, Timon Gehr wrote:
>> I haven't had time yet to contribute a thorough review, but one thing 
>> that stands out to me is that there seems to be no discussion of 
>> interaction with `const`/`immutable`, etc. Given that that's a source 
>> of unsoundness for postblit, maybe it deserves some explicit 
>> consideration?
> 
> All the problems with const/immutable revolved around postblit. That's 
> why this proposal has zero reliance on postblit.

My concern was that similar mistakes can be repeated. You don't ensure 
correctness just by avoiding the precise set of previous mistakes; it's 
always possible to make new, slightly different mistakes.

The design of immutable and the design of postblit took place 
independently of each other and they ended up being incompatible. Why is 
the same thing not happening now? The DIP seems to assume there is no 
such thing as immutable, just like postblit did. A naive implementation 
of the DIP might therefore implicitly cast away immutable, just like 
postblit did.


More information about the Digitalmars-d mailing list