How is Generic Covariance & Contra-variance Implemented in C# 4.0?

后端 未结 2 524
别跟我提以往
别跟我提以往 2020-11-22 11:14

I didn\'t attend PDC 2008, but I heard some news that C# 4.0 is announced to support Generic covariance and contra-variance. That is, List can be

2条回答
  •  闹比i
    闹比i (楼主)
    2020-11-22 11:39

    Not that Jon hasn't already covered it, but here are some links to blogs and videos from Eric Lippert. He does a nice job of explaining it with examples.

    https://blogs.msdn.microsoft.com/ericlippert/2007/10/16/covariance-and-contravariance-in-c-part-one/

    The videos:

    https://www.youtube.com/watch?v=3MQDrKbzvqU

    https://www.youtube.com/watch?v=XRIadQaBYlI

    https://www.youtube.com/watch?v=St9d2EDZfrg

提交回复
热议问题