Template functions, can we make it more simple?
H. S. Teoh
hsteoh at quickfur.ath.cx
Sat Aug 3 11:03:20 PDT 2013
On Fri, Aug 02, 2013 at 04:29:39PM -0700, H. S. Teoh wrote:
[...]
> How would you translate this to the new syntax:
>
> class A(T,U)
> {
> T fun1(U x) { ... }
> U fun2(T x) { ... }
> V fun3(V)(V x) { ... }
> auto fun4(T)(T x) { ... }
> auto fun5(V)(T x, V y) { ... }
> const(T) fun6(T x) { ... }
>
> T p;
> T q;
> U r;
> U s;
> }
[...]
Since no good answer is forthcoming, I'm forced to conclude that the new
syntax is only marginally useful, and doesn't handle all the cases the
current syntax can. So I don't think this change is worth the effort.
T
--
The computer is only a tool. Unfortunately, so is the user. -- Armaphine, K5
More information about the Digitalmars-d
mailing list