Wildcard for arbitrary generic List

前端 未结 2 888
鱼传尺愫
鱼传尺愫 2021-01-27 05:35

I have a class MyClass, which is not generic and contains and does something with an arbitrary TList. I wish to replace the TList with the generic TList, but MyClass has to stay

2条回答
  •  旧时难觅i
    2021-01-27 06:18

    The answer is no, this cannot be done. You cannot include in non-generic class, an object of a non-instantiated generic type.

提交回复
热议问题