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

vitamin vit at vit.vit
Wed Mar 17 06:35:16 UTC 2021


On Friday, 5 March 2021 at 12:19:54 UTC, Mike Parker wrote:
> This is the discussion thread for the first round of Community 
> Review of DIP 1040, "Copying, Moving, and Forwarding":
>
> https://github.com/dlang/DIPs/blob/a9c553b0dbab1c2983a801b5e89b51c5c33d5180/DIPs/DIP1040.md



Hello,

I like this dip but, must be move/copy methods ctors? Because 
there need to be distinctions between copy/move ctors and other 
ctors, all copy/move ctors are non templates and that make some 
problems.

Something like opMoveCtor and opCopyCtor are easier differentiate 
from others ctors and can be template:

void opMoveCtor(T, this This)(T rhs){  //traits like 
hasMoveConstructor can work without instantion of opMoveCtor

}

instead of

this(typeof(this) rhs){/*...*/}
this(const typeof(this) rhs)const {/*...*/}
this(immutable typeof(this) rhs)immutable {/*...*/}

//and all other combination including inout and sometimes shared.



More information about the Digitalmars-d mailing list