¡@

Home 

c# Programming Glossary: giraffe

C# : Why doesn't 'ref' and 'out' support polymorphism?

http://stackoverflow.com/questions/1207144/c-sharp-why-doesnt-ref-and-out-support-polymorphism

Let's suppose you have classes Animal Mammal Reptile Giraffe Turtle and Tiger with the obvious subclassing relationships... can contain more things. Can you pass a variable of type Giraffe to M No. M can write to m and M might want to write a Tiger.. put a Tiger into a variable which is actually of type Giraffe. Conclusion 2 Ref parameters cannot be made smaller . Now consider..

C# variance problem: Assigning List<Derived> as List<Base>

http://stackoverflow.com/questions/2033912/c-sharp-variance-problem-assigning-listderived-as-listbase

example partially taken from MSDN Blog class Animal class Giraffe Animal static void Main string args Array assignment works but..... args Array assignment works but... Animal animals new Giraffe 10 implicit... List Animal animalsList new List Giraffe ...and.. Giraffe 10 implicit... List Animal animalsList new List Giraffe ...and explicit casting fails List Animal animalsList2 List..

Operation could destabilize the runtime?

http://stackoverflow.com/questions/378895/operation-could-destabilize-the-runtime

Animals IEnumerable when that IEnumerable can only contain Giraffes . I think the reason it works when you return IQueryable is.. to return only those elements that can be cast to Giraffe. I'm pretty sure it has something to do with the issues of type..

c# covariant return types utilizing generics

http://stackoverflow.com/questions/4348760/c-sharp-covariant-return-types-utilizing-generics

B public override Tiger Animal ... B b new D b.Animal new Giraffe and hey we just passed a Giraffe to a setter that is expecting.. B b new D b.Animal new Giraffe and hey we just passed a Giraffe to a setter that is expecting a Tiger. If we supported this..

Why is Func<T> ambiguous with Func<IEnumerable<T>>?

http://stackoverflow.com/questions/4573011/why-is-funct-ambiguous-with-funcienumerablet

type. If you have two applicable candidates M Animal and M Giraffe we choose the Giraffe version because a Giraffe is more specific.. applicable candidates M Animal and M Giraffe we choose the Giraffe version because a Giraffe is more specific than an Animal. We.. and M Giraffe we choose the Giraffe version because a Giraffe is more specific than an Animal. We know that Giraffe is more..