Friday, June 7, 2013

Covariance: Not in ICollection



class Base {
    void Foo (ICollection<Base> col) {}
}
class Drvd : Base {
    void
}

var b = Base;
var d = Drvd;

HashSet<Drvd> hs;

b.Foo(hs); // cannot convert Drvd to Base

No comments:

Post a Comment

창 핸들을 만드는 동안 오류가 발생했습니다

System.ComponentModel.Win32Exception was unhandled   MyForm w = new MyForm IntPtr handle = wnd.Handle;   // Exception occurs here class MyFo...