3 ms·
I love this feature! It's also recursive, you can have the following: struct A { int a; alias a this; } struct B { A a; alias a this; } struct C { B b; alias b
by jeremiep 12y ago
I love this feature! It's also recursive, you can have the following:
struct A { int a; alias a this; }
struct B { A a; alias a this; }
struct C { B b; alias b this; }
static assert(C(42) == 42);
Combined with D's support for compile-time protocols, this allows for some very expressive, powerful and lighting fast code.