Proper way to handle "alias this" deprecation for classes

Chris Piker chris at hoopjump.com
Sun May 7 20:44:55 UTC 2023


On Sunday, 7 May 2023 at 18:19:04 UTC, Ali Çehreli wrote:
> auto main() {
>     auto c = new C();
>
>     // The same type conversion is now explicit:
>     foo(c.asIntPtr);
> }
>
Hi Ali

Ah, very clear explanation, thanks!  So basically to fix the 
problem I just delete the alias this line from dpq2, see what 
unit tests and app code it breaks, then fix each of those.  
Actually seems straightforward, for a limited code base anyway.

On a side note, with all the free help you've provided, it's 
about time I gave back.  Since I've no free time or expertise to 
offer, I picked up a hardcover copy of "Programming in D" for a 
bright young programming student I know in appreciation.

Cheers,




More information about the Digitalmars-d-learn mailing list