Default for generic type?
Posted
by Mark
on Stack Overflow
See other posts from Stack Overflow
or by Mark
Published on 2010-04-30T21:39:30Z
Indexed on
2010/04/30
21:47 UTC
Read the original article
Hit count: 229
Is it possible to do something like
public class PriorityQueue<TValue, TPriority=int> where TPriority : IComparable
(note the =int
) ?
Before you suggest it, yes, I know I can just add another line:
public class PriorityQueue<TValue> : PriorityQueue<TValue, int> { }
But I'm wondering if it's possible to do it as a param.
© Stack Overflow or respective owner