Hi!
How can I call the matching constructor
foreach (Animal d in AnimalBufferList)
{
this.Add( ....call matching copyconstructor.... (d) );
}
.
.
.
abstract class Animal
{
public Animal (Animal d)
{
}
.
}
}
class Pig: Animal
{
public Pig(Pig d): base(d)
{
}
}
class Cow: Animal
{
public Cow(Cow d): base(d)
{
}
}
I want add a new (a copy of a) cow or pig to my animal list.
this = class AnimalList : List<Animal>
To do this i need to call the correct copy constructor. Is there a way to do this??
Greetings from Austria Annex31B