"Joe" <jo************@globetrotter.netwrote in message
news:11**********************@w3g2000hsg.googlegro ups.com...
Hi,
I found a concept named template metaprogramming that can be used in C+
+ code at compile-time. I am a beginner at C++. But I am a programmer
on the .NET platform. Do you know if template metaprogramming is
supported in C# (.NET)? For reference I found it:
http://en.wikipedia.org/wiki/Template_metaprogramming.
Thanks to all.
No, there is absolutely nothing similar to template metaprogramming in .NET.
Template metaprogramming relies on specializations which generics do not
have.
OTOH, .NET makes it very easy to generate code on the fly via
Reflection.Emit. Performance is not likely to be as good as template
programs run through the C++ compiler (in fact C++ templates are much more
performant than .NET generics even for collection classes, because the C++
compiler will optimize per type and the .NET JIT creates one shared generic
implementation for all reference types).