D vs C++ metaprogramming: why are c++ templates inherently slow

evansl cppljevans at suddenlink.net
Sun Nov 4 08:44:30 PST 2012


This post is in response to Nick's suggestion in this post:


http://forum.dlang.org/thread/k524ke$gvt$1@digitalmars.com#post-20121104000747.00001f10:40unknown

to repost the question here. (please note I have read the
link Nick provided, but as noted in my last post to the c++
list, that link, although very convincing, did not answer
my question about why ADL and partial specialization are
one of the causes of slow compile times.)

So here's the original post to the c++ newsgroup:

In this post:

  http://article.gmane.org/gmane.comp.lib.boost.devel/189925

Eric indicates that Walter Bright believes, in c++:

  that instantiating a template is inherently expensive, and certain
  features of the C++ language (ADL, partial specialization, etc.)
  force that to be the case.

Walter, if Eric is remembering correctly, could you provide a little
more explanation on why this is so or provide a link to some document
supporting this conclusion?

TIA.

-regards,
Larry






More information about the Digitalmars-d mailing list