I know of no way to create a templated constructor for a class. (This is useful, for instance, with variadic template args). The following code fails to parse in compilation: class Foo { this(T...)(T t) {} }
The problem seems to be that the current D syntax doesn't support it: Constructor: this Parameters FunctionBody Parameters: ( ParameterList ) ( ) The alternative would be class Foo { template(T...) this { this(T t) {} } } except that this doesn't work because 'this' is a keyword, not an identifier.
*** This issue has been marked as a duplicate of issue 435 ***