Cast a hashtable.Keys into List or other IEnumerable

后端 未结 6 725
伪装坚强ぢ
伪装坚强ぢ 2020-12-31 16:40

I know, I have other options, e.g. I could maintain a separate list of keys. Please don\'t suggest other options. I simply want to know if I can pull this off. Please don\'t

6条回答
  •  长情又很酷
    2020-12-31 16:53

    Because hashtable.Keys is a collection of objects which is not covariant with a list of integers.

提交回复
热议问题