Implicit conversion between structs?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Oct 31 05:58:11 PDT 2011


On 10/31/11 4:43 AM, Steve Teale wrote:
> Is there a way to do this. For example if I have
>
> struct A { int a, b, c; }
> struct B
> {
>     int p, q, r, s;
>     this(A a) { p = a.a; q = a.b; r = a.c; }
> }
>
> A a;
> B b;
> b = a;

Use opAssign?

Andrei


More information about the Digitalmars-d mailing list