On 8/8/11, KennyTM~ <kenn...@gmail.com> wrote: > Template-mixin is often shorter and less error-prone. > ----------------- > > mixin template FieldInit(size_t count, alias fun) > { > this(RepresentationTypeTuple!(typeof(this))[0..count] params) > { > foreach (y, x; __traits(allMembers, typeof(this))[0..count]) > __traits(getMember, this, x) = params[y]; > fun(); > } > } >
Yum! That's much sexier, thanks.