The generic definition has a
where
clause that tells the compiler that the actual
TNode
type must implement
IComparable<TNode>
. So, the compiler knows that the instanciated generic type has a
CompareTo(...)
method.
You can only instanciate
BinaryTreeNode<...>
with a type that fulfills that
where
constraint. E.g.
string
fulfills that constraint. See
http://msdn.microsoft.com/en-us/library/system.string.aspx[
^]:
[SerializableAttribute]
[ComVisibleAttribute(true)]
public sealed class String : IComparable,
ICloneable, IConvertible, IComparable<string>, IEnumerable<char>,
IEnumerable, IEquatable<string>
Cheers
Andi