Basically my setting is this:
public abstract class BaseObject{
public abstract BaseObject Clone();
}
public class DerivedObject : BaseObject{
public DerivedObject Clone()
{
//Clone logic
}
}
The above code doesn't compile because it isn't possible to change the return type when overriding a method.
Is it possible to achieve that every derived type's Clone method returns an argument of it's own type (maybe through generics)?