implicit conversion to alias this
Jonathan M Davis
jmdavisProg at gmx.com
Thu Jun 28 20:42:01 PDT 2012
On Monday, June 25, 2012 22:06:20 Tobias Pankrath wrote:
> ---------
> struct A { bool a; alias a this; }
> struct B { int b; alias b this; }
>
> A a = false; // works
> B b = 12; // works
>
> struct C
> {
> A aa;
> B ab;
> }
>
> C c = { false, 12 }; // does not work, because the implicit
> conversion does not happen.
> -----
>
> What is the reason to allow the first two assignments? Isn't it
> just another implicit conversion that shouldn't be allowed?
They don't compile on the latest master, so I guess that it was a bug in 2.059
which was fixed.
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list