I have a class of this type:
class A<TResult> { public TResult foo(); }
But sometimes I need to use this class as not a general class, i.e. type TResult - void .
I cannot create an instance of the class as follows:
var a = new A<void>();
Also, I would prefer not to specify a type that omits angle brackets:
var a = new A();
I do not want to rewrite the whole class because it does the same.
Nick
source share