2 ms·
D uses "()" for type declaration and "!()" for instantiation: template TCopy(T) { void copy(out T to, T from) { to = from; }
by ainar-g 6y ago
D uses "()" for type declaration and "!()" for instantiation:
template TCopy(T)
{
void copy(out T to, T from)
{
to = from;
}
}
/* … */
int i;
TCopy!(int).copy(i, 3);
The parens can also be omitted in some cases.