38
Ist es möglich, so etwas wieStandard für generischen Typ?
public class PriorityQueue<TValue, TPriority=int> where TPriority : IComparable
(beachten Sie die =int
) zu tun?
Bevor Sie es vorschlagen, ja, ich weiß, ich kann nur eine weitere Zeile hinzufügen:
public class PriorityQueue<TValue> : PriorityQueue<TValue, int> { }
Aber ich frage mich, ob es möglich ist, es als param zu tun.
das ist eine nette C# 5.0 Option –