dc.wire

This module adds declares a mixin template for automatically generating class constructor. Generated constructor takes 1 argument per each field declared with @wired attribute. Later each argument gets assigned to its respective field.

Members

Enums

wired
enum wired

An attribute to decorate fields about which wire should care

Mixin templates

wire
mixintemplate wire()

Mixin template that generates our class constructor

Examples

class A {
	@wired {
		int a;
		string b;
		float c;
	}

	mixin wire;
}
auto a = new A(1, "hi", 42.0);
assert(a.a == 1 && a.b == "hi" && a.c == 42.0);

Meta