DIP66 v1.1 (Multiple) alias this.

Joseph Rushton Wakeling via Digitalmars-d digitalmars-d at puremagic.com
Sat Dec 27 04:28:25 PST 2014


On 26/12/14 19:53, Daniel N via Digitalmars-d wrote:
> Anyway considering the new ways of working, when using the -dip switch for the
> initial few releases, there is ample time to perfect all details.

Potentially related issue, regarding implicit conversion.  Given a struct as 
follows:

     struct Integer
     {
         int i_;

         alias i_ this;
     }

Can anyone explain to me why this works:

     Integer i = Integer(3);
     i = 5;

... but this doesn't:

     Integer i = 5;

It seems unintuitive, in the circumstances.


More information about the Digitalmars-d mailing list