Why is it impossible to declare extension methods in a generic static class?

后端 未结 6 1495
忘了有多久
忘了有多久 2020-12-03 10:43

I\'d like to create a lot of extension methods for some generic class, e.g. for

public class SimpleLinkedList where T:IComparable

6条回答
  •  -上瘾入骨i
    2020-12-03 11:12

    Just a thought, but is there any reason you can't just derive from this class and add the extra methods to the specialization rather than writing a suite of extension methods? I am sure you have your reasons but just throwing that out there.

提交回复
热议问题