What would be the consequence of implementing interfaces as fat pointers ?

Walter Bright newshound2 at digitalmars.com
Mon Mar 31 00:28:39 PDT 2014


On 3/30/2014 8:32 PM, Adam D. Ruppe wrote:
> On Monday, 31 March 2014 at 03:25:11 UTC, Manu wrote:
>> I also feel quite dirty using pointers in D where there is a dedicated
>> reference type available. I don't want * and & to appear everywhere in my D code.
>
> structs can pretty easily be reference types too:

Or just:

    alias S* C;

Voila! Use C as the type instead of S*. The reason this works out so well in D 
is because C.member works (no need to use -> )



More information about the Digitalmars-d mailing list