Skip to content

Commit

Permalink
Added clarification on the generic interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
aubertc committed Nov 21, 2024
1 parent 52aba4f commit 6c21fc9
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions source/code/projects/Shape/Shape/IComparable.cs
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.*/
}

0 comments on commit 6c21fc9

Please sign in to comment.