N
not_a_commie
I was hoping for increased functionality with the where clause in C#
3.0. Using the new keyword 'var' would really allow us to take nice
advantage of these. Specifically:
1. I want to limit it to primitives: "where T : System.Type.Primitive"
or something like that.
2. I want to limit it to an unspecified generic: "where T : List<>".
3. I want to limit it to a generic with a subset of types: "where T :
List<new TT> where TT : class" or something similar.
4. I want to limit to a class with a certain property or method: "where
T : interface MyFunc(int), interface operator+=(int), interface get
MyProperty(int)" or something similar.
5. I want a default type: "where T default(MyType): IMyType" or
something similar so that I don't have to specify the type in all
situations. If it leads to ambiguous functions, throw an error.
6. Specify a namespace: "where T in System : class" or something like
that.
7. I want to AND/OR the conditions for the where clause together.
Thoughts? Comments? Complaints?
3.0. Using the new keyword 'var' would really allow us to take nice
advantage of these. Specifically:
1. I want to limit it to primitives: "where T : System.Type.Primitive"
or something like that.
2. I want to limit it to an unspecified generic: "where T : List<>".
3. I want to limit it to a generic with a subset of types: "where T :
List<new TT> where TT : class" or something similar.
4. I want to limit to a class with a certain property or method: "where
T : interface MyFunc(int), interface operator+=(int), interface get
MyProperty(int)" or something similar.
5. I want a default type: "where T default(MyType): IMyType" or
something similar so that I don't have to specify the type in all
situations. If it leads to ambiguous functions, throw an error.
6. Specify a namespace: "where T in System : class" or something like
that.
7. I want to AND/OR the conditions for the where clause together.
Thoughts? Comments? Complaints?