Skip to content

Glossary: C# Beyond the Basics

IComparable<T>

Also written: CompareTo

An interface promising a `CompareTo` method that says whether one item comes before, equal to or after another. Numbers and strings implement it, so `where T : IComparable<T>` lets generic code compare items.

Where the book teaches it

Related terms

constraintgeneric