Useful in copy constructors for DRY.
Usage:
class myClass { // Declarations of 'someVar', 'a1', 'b', and 'c' here. this(myClass copyOf) { mixin(initMemberFrom("copyOf", "someVar")); mixin(initMemberFrom("copyOf", "a1", "b", "c")); } }
Turns Into:
class myClass { // Declarations of 'someVar', 'a1', 'b', and 'c' here. this(myClass copyOf) { this.someVar = copyOf.someVar; this.a1 = copyOf.a1; this.b = copyOf.b; this.c = copyOf.c; } }
See Implementation
Useful in copy constructors for DRY.
Usage:
Turns Into: