C #2.0 generic has been available for a long time. I believe you have a lot of knowledge about it.
The concise syntax and the limitation of where make it look more elegant than the C ++ template. However, due to the limitations of the C # compiler itself, it is probably not competent for generic programming methods like Loki. The biggest restriction is that a class cannot be inherited from its template class, similar to the following Code Public Class Foo < T > : T
{
This cannot be compiled in C #2.0. This technique is the basic usage of policy in C ++ generic programming.
Another important technology in C ++ generic progrmming is partial specialization. This is not supported in C #2.0. At most, you can obtain similar functions from function overloading.
In general, C #2.0 generics are slightly more comfortable than java1.5, especially when runtime reflection is used to obtain complete generic information about the code, this should be a major advantage.