`alias this` pointers and typeof(null)

Tomer Filiba via Digitalmars-d digitalmars-d at puremagic.com
Sat Jan 30 11:49:56 PST 2016


On Saturday, 30 January 2016 at 17:49:41 UTC, Nick Treleaven 
wrote:
> I've heard (on This Week in D) that C++ implicit construction 
> wouldn't be so bad if it only worked when a constructor was 
> specially marked for that purpose, e.g.:
>
> struct FooPtr {
>   ...
>   @implicit this(typeof(null)) {ptr = null;}
> }
>
> Then null could be passed as a FooPtr.

+1 on that!


More information about the Digitalmars-d mailing list