DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
DotNetDupe::System::IComparable< T > Interface Template Referenceabstract

Defines a generalized type-specific comparison method that a value type or class implements to order or sort its instances. More...

#include <Comparable.h>

Public Member Functions

virtual ~IComparable ()=default
 Virtual destructor for polymorphic cleanup.
virtual ~IComparable ()=default
 Virtual destructor for polymorphic cleanup.
virtual int CompareTo (const Object &obj)=0
 Compares the current instance with another object and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
virtual int CompareTo (const T &other)=0
 Compares the current instance with another object of the same type and returns an integer indicating relative order.

Detailed Description

template<class T>
interface DotNetDupe::System::IComparable< T >

Defines a generalized type-specific comparison method that a value type or class implements to order or sort its instances.

Defines a generalized comparison method that a value type or class implements to create a type-safe comparison method for ordering or sorting its instances.

Standard Citation: ECMA-335 CLI Common Language Infrastructure.

Template Parameters
TThe type of object to compare. Standard Citation: ECMA-335 CLI Common Language Infrastructure.

Definition at line 15 of file Comparable.h.

Constructor & Destructor Documentation

◆ ~IComparable() [1/2]

template<class T>
virtual DotNetDupe::System::IComparable< T >::~IComparable ( )
virtualdefault

Virtual destructor for polymorphic cleanup.

◆ ~IComparable() [2/2]

template<class T>
virtual DotNetDupe::System::IComparable< T >::~IComparable ( )
virtualdefault

Virtual destructor for polymorphic cleanup.

Member Function Documentation

◆ CompareTo() [1/2]

template<class T>
virtual int DotNetDupe::System::IComparable< T >::CompareTo ( const Object & obj)
pure virtual

Compares the current instance with another object and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.

Parameters
objAn object to compare with this instance.
Returns
A value that indicates the relative order of the objects being compared. Less than zero: this instance precedes obj. Zero: this instance occurs in the same position. Greater than zero: this instance follows obj.

◆ CompareTo() [2/2]

template<class T>
virtual int DotNetDupe::System::IComparable< T >::CompareTo ( const T & other)
pure virtual

Compares the current instance with another object of the same type and returns an integer indicating relative order.

Parameters
otherAn object to compare with this instance.
Returns
A value that indicates the relative order of the objects being compared. Less than zero: this precedes other. Zero: same position. Greater than zero: this follows other.

The documentation for this interface was generated from the following files: