DIP 1040
Timon Gehr
timon.gehr at gmx.ch
Sun Jul 14 10:39:47 UTC 2024
On 7/14/24 08:44, Richard (Rikki) Andrew Cattermole wrote:
> On 14/07/2024 4:51 AM, Walter Bright wrote:
>> On 7/12/2024 11:36 PM, Richard (Rikki) Andrew Cattermole wrote:
>>> On 13/07/2024 7:46 AM, Walter Bright wrote:
>>>> https://github.com/dlang/DIPs/blob/master/DIPs/DIP1040.md
>>>>
>>>> We're going to get back on it.
>>>
>>> We did some reading and reviewing of it last night.
>>
>> We?
>
> Oh right, me, Paul, Steven and Timon were talking on Discord, if I
> remember right.
Well, I don't think the presented points describe my position.
For the record: I am on board with DIP1040, except for the error-prone
design of destructor elision in move constructors and move assignment
operators. I think should be explicit.
e.g.
```d
this(S s){
// perhaps copies some the members of `s` instead of moving them
} // destructor of s called here
```d
this(S s){
// move out the guts of `s` one by one
// ...
ignore(s); // explicitly elide destructor call
}
```
and/or
```d
this(S s){
// destructure and move:
this.tupleof = s.moved_tupleof;
// s is gone here, no destructor will be called
}
```
More information about the Digitalmars-d
mailing list