The definition of templates in D
Derek
ddparnell at bigpond.com
Sun Mar 18 04:05:09 PDT 2012
On Sun, 18 Mar 2012 21:36:46 +1100, FeepingCreature
<default_357-line at yahoo.de> wrote:
> why would you do that
To make coding easier to write AND read.
> what do you want to _do_
Infer template arguments from the data types presented in the data values
supplied on the instantiation statement.
> it sounds like you're frantically trying to nail templates into a shape
> that they really really really aren't meant for
I assumed D templates were a type of template; a model for real runnable
code that the compiler can instantiate based on the arguments supplied.
> in any case what is wrong with auto add(T)(T t) { return t[0] + t[1]; }
It doesn't work.
--
Derek Parnell
Melbourne, Australia
More information about the Digitalmars-d
mailing list