What's the equivalent of a C++ template in Visual Basic.NET?

c++, generics, templates, vb.net

Solution

VB.NET doesn't provide any kind of metaprogramming built into the language. Like the rest of the .Net languages, your main tool is type generics. http://msdn.microsoft.com/en-us/library/w256ka79.aspx

You can emulate certain aspects of C++ templates by using the T4 text generation system that will allow you to have arbitrarily complex code generation.

http://msdn.microsoft.com/en-us/library/bb126478.aspx

Problem

Does VB.NET provide a way to define the equivalent to a C++ template, such as a function template or a class template? If so, does template specialization work the same way, and provide the same behaviors? Or are templates a C++ operation that cannot be perfectly translated into VB.NET?

Original source