Toughts on alias this. (implict converstion in general)

Timon Gehr timon.gehr at gmx.ch
Wed May 13 22:27:00 UTC 2020


On 13.05.20 23:06, 12345swordy wrote:
> As I am working on the tuple dip and porting Timon Gehr work, I noticed 
> that there is a section on alias this which got me thinking. I really 
> don't want the ability to alias this the tuple itself as that could 
> cause problems in the future. It seems that Walter share the same 
> negative sentiment regarding alias this. We could introduce implicit 
> constructors for structs/classes for rvalues and implicitOP for lvalues 
> by having structs copy it and having classes GC allocate it. That way we 
> could introduce implicit conversion without having the rest of the 
> baggage that alias this introduce.(Credit for manu for coming up the 
> idea). Of course this is all opt-in from the developer side to prevent 
> unintentional function design.
> 
> 
> - Alex

Do you understand how std.typecons.Tuple works?
Do you understand _why_ there is a section in the DIP related to alias this?


More information about the Digitalmars-d mailing list