opImplictCast questions

Steven Schveighoffer schveiguy at yahoo.com
Thu Nov 29 16:15:03 PST 2007


When opImplicitCast comes along, if I do the following:

typedef int X;

struct Y
{
   X opImplicitCast() {...}
}

This should compile:

Y y;
X x = y;

Should this?

Y y;
int i = y;

(hint hint: I would like it NOT to compile)

Also, I know const is out and that's great and all, but when do we get 
opImplicitCast?

Not to be pushy or anything :)

-Steve 





More information about the Digitalmars-d mailing list