Possible Duplicate:
Impossible recursive generic class definition?
I just discovered that
public class Foo<T> where T : Foo<T>
{
}
is legal. What exactly does it mean? It seems
recursive and is it possible to instantiate something
like this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I wouldn’t say that this is useless. Let’s observe the below example how to support fluent syntax. In cases, that you are creating some
baseimplementation in a Parent and would like to provide fluent declarations… you can use this constraint this wayPlease, take it just an example, of how this constraint could be used