In c# what does 'where T : class' mean?

前端 未结 10 1971
太阳男子
太阳男子 2020-11-29 18:53

In C# what does where T : class mean?

Ie.

public IList DoThis() where T : class
10条回答
  •  粉色の甜心
    2020-11-29 19:23

    It is a generic type constraint. In this case it means that the generic type T has to be a reference type (class, interface, delegate, or array type).

提交回复
热议问题