1 module dopt.nnet.layers.util; 2 3 string dynamicProperties(Args...)(Args args) 4 { 5 static if(args.length > 0) 6 { 7 return " 8 public " ~ args[0] ~ " " ~ args[1] ~ "() { return _" ~ args[1] ~ "; } 9 public typeof(this) " ~ args[1] ~ "(" ~ args[0] ~ " p) { _" ~ args[1] ~ " = p; return this; } 10 private " ~ args[0] ~ " _" ~ args[1] ~ "; 11 " ~ dynamicProperties(args[2 .. $]); 12 } 13 else 14 { 15 return ""; 16 } 17 }