I have the Node implementing the TreeNode as normal without the GetMin/GetMax:
public class SimpleTreeNode<T> : ITreeNode<T, SimpleTreeNode<T>> where T : IComparable<T>
...
public class SimpleTreeNode<T> : ITreeNode<T, SimpleTreeNode<T>> where T : IComparable<T>
...
and then when I try to use it
class SimpleTree<T> : ITree<T, SimpleTreeNode<T>, SimpleTree<T>>
where T : IComparable<T>
{
SimpleTreeNode<T>? root;
public T? GetMax()
{
if (this.root == null) {return default(T);}
return this.GetRoot()!.GetMax();
}
}
class SimpleTree<T> : ITree<T, SimpleTreeNode<T>, SimpleTree<T>>
where T : IComparable<T>
{
SimpleTreeNode<T>? root;
public T? GetMax()
{
if (this.root == null) {return default(T);}
return this.GetRoot()!.GetMax();
}
}
I get
'SimpleTreeNode<T>' does not contain a definition for 'GetMax' and no accessible extension method 'GetMax' accepting a first argument of type 'SimpleTreeNode<T>' could be found (are you missing a using directive or an assembly reference?)
'SimpleTreeNode<T>' does not contain a definition for 'GetMax' and no accessible extension method 'GetMax' accepting a first argument of type 'SimpleTreeNode<T>' could be found (are you missing a using directive or an assembly reference?)