Wouldn't it be nice to have a type variable referring to the class's instance.
- by user93197
I often have a pattern like this:
class VectorBase<SubClass, Element>
where SubClass : VectorBase<SubClass, Element>, new()
where Element : Addable<Element>
{
Element[] data;
public VectorBase(Element[] data)
{
this.data = data;
}
public SubClass add(SubClass second)
{
Element[]…