-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added clarification on the generic interface.
- Loading branch information
Showing
1 changed file
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
/* | ||
* This class uses the generic interface, | ||
* https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/generics/generic-interfaces | ||
* The generic T must be instantiated. | ||
* This code is actually very close to the one used by C#, | ||
* cf. | ||
* https://learn.microsoft.com/en-us/dotnet/api/system.icomparable-1.compareto?view=net-9.0 | ||
*/ | ||
public interface IComparable<T> | ||
{ | ||
int CompareTo(T arg); | ||
/* Compares this object with the specified object for order. | ||
/* Compares the calling object with | ||
* the object passed as an argument. | ||
* Returns a negative integer, zero, or a positive | ||
* integer as this object is less than, equal to, or greater | ||
* integer as the calling object is less than, | ||
* equal to, or greater | ||
* than the specified object.*/ | ||
} |