Paulo Pinto <pj...@progtools.org> wrote:

Sorry but I still don't get it.

Do you mean that the types that erased and the same code is generated?

Then let me say that .Net generics get generated on the fly and JITed for
each
different type.

Eiffel and Modula-3 generics also have specific generated code for each
type.

The major difference regarding C++ code is that the linkers are smarter and
are
able to remove duplicates of the generated code for the same set of type
arguments.

The point is, D and C++ templates can do a lot more than simple generics.
Generics is limited to simple copying and pasting of type names, whereas
templates can build a DSL parser for you, let you choose whether a
function should be parallelized, a type thread-safe, etc.


--
Simen

Reply via email to