> Why is omitting the fact that T is a type useful?
It's the default, because most templates are templated on types. If you want a constant int as part of the template type,
ArrayListType(int I)
> This reminds me of C in the 1970s where the compiler assumed every typo was a new variable of type int
I think you're referring to function declarations without prototypes. D's syntax does not suffer from that issue.
BTW,
T func(T)(T x) { return x + 1; }
is a declaration of a "function template". The first parameter list consists of the template parameters, and are compile time types and constants. The second parameter list is the conventional function parameter list. If the first parameter list is omitted, then it's a function.
> Why is omitting the fact that T is a type useful?
It's the default, because most templates are templated on types. If you want a constant int as part of the template type,
> This reminds me of C in the 1970s where the compiler assumed every typo was a new variable of type intI think you're referring to function declarations without prototypes. D's syntax does not suffer from that issue.
BTW,
is a declaration of a "function template". The first parameter list consists of the template parameters, and are compile time types and constants. The second parameter list is the conventional function parameter list. If the first parameter list is omitted, then it's a function.