A
abiz
What is the current thinking about specializing generic C# types?
I've come across a situation where I'd like to do something like this:
struct X<T,U>
{
...
}
struct XCommonCase<T> = X<T,bool>
Even if this example used classes and not structs, inheritance wouldn't
quite be the right thing here. The only way I know of to get this
specialization is to clone X in XCommonCase. It'd be nice if there
were something better.
It might also be useful to have similar specialization with generic
methods.
I've come across a situation where I'd like to do something like this:
struct X<T,U>
{
...
}
struct XCommonCase<T> = X<T,bool>
Even if this example used classes and not structs, inheritance wouldn't
quite be the right thing here. The only way I know of to get this
specialization is to clone X in XCommonCase. It'd be nice if there
were something better.
It might also be useful to have similar specialization with generic
methods.