Understanding Templates: why can't anybody do it?

H. S. Teoh hsteoh at quickfur.ath.cx
Mon Mar 19 12:37:25 PDT 2012


On Mon, Mar 19, 2012 at 02:27:04PM -0500, Andrei Alexandrescu wrote:
> On 3/19/12 1:59 PM, Sean Kelly wrote:
> >I see this a lot, and it's why I wrote the chapter on templates for
> >Learn to Tango with D.  I don't think I can sort out releasing the
> >chapter though.  One approach is to think of templates as
> >compile-time polymorphism.  In Java, you might create a linked-list
> >as:
> [snip]
> 
> There have been a couple of long good answers in this thread, and it
> would be a shame to let them scroll by the way newsgroup messages
> do. I suggest authors to repackage their posts as blog entries or
> articles.
[...]

It would be nice if somebody could write up a general introduction to
the idea of templates (not specific to D), the motivations behind it,
perhaps some historical background, and then eventually lead up to
advanced template tricks using D as the prime example.

Then not only we can point newbies at the document, but it can also
serve as D propaganda.

I'd take a stab at this, except that my free time is limited and most of
it is currently being used for refining my AA implementation so that it
can (hopefully) replace the current AA mess.


T

-- 
"Hi." "'Lo."


More information about the Digitalmars-d mailing list