What exactly is this error message complaining about?
I'm trying to create a node class that can hold a value and point to other nodes, as well as be expanded to have more information embedded inside each of the nodes. The recursive templates are giving me some issues though.
public class ColoredNode<T> : Node<ColoredNode<T>, T>
where T : IComparable
{
public ConsoleColor Color;
}
public class BaseNode<T> : Node<BaseNode<T>, T>
where T : IComparable
{
}
abstract public class Node<N, T>
where N : Node<N, T>, new()
where T : IComparable
{
public N Parent;
public N Child;
public T Value;
}
GenericArguments[1], 'T', on 'Node`2[N,T]' violates the constraint of type parameter 'T'.