How do I specify multiple generic type constraints on a single method?

前端 未结 4 555
傲寒
傲寒 2021-01-07 16:09

I can restrict generics to a specify type using the \"Where\" clause such as:

public void foo() where TTypeA : class, A

How d

4条回答
  •  太阳男子
    2021-01-07 17:04

    Something like this?

     public void foo() where TTypeA : class where TTypeB : class
    

提交回复
热议问题