ORIGINAL
|
Base class for comparable objects. More...
#include <comparable.h>
Public Member Functions | |
virtual integer | compareTo (const DERIVED &other) const =0 |
Compares the current object with another of the same type. | |
bool | operator== (const DERIVED &other) const |
Checks if the current object is equal to another. | |
bool | operator!= (const DERIVED &other) const |
Checks if the current object is not equal to another. | |
bool | operator< (const DERIVED &other) const |
Checks if the current object is less than another. | |
bool | operator> (const DERIVED &other) const |
Checks if the current object is greater than another. | |
bool | operator<= (const DERIVED &other) const |
Checks if the current object is less than or equal to another. | |
bool | operator>= (const DERIVED &other) const |
Checks if the current object is greater than or equal to another. | |
virtual | ~comparable ()=default |
Virtual destructor for proper cleanup of derived objects. | |
Base class for comparable objects.
DERIVED | The type of the derived class. |
This class defines a compareTo()
method that must be implemented by derived classes to compare their instances. It also provides common comparison operators (==
, !=
, <
, >
, <=
, >=
) based on the compareTo()
method.
Derived classes are expected to override compareTo()
to return:
Classes implementing this interface automatically satisfy the CmpTraits
concept.
|
pure virtual |
Compares the current object with another of the same type.
other | The object to compare against. |
Implemented in original::autoPtr< TYPE, DERIVED, DELETER >, original::containerAdapter< TYPE, SERIAL, ALLOC >, original::couple< F_TYPE, S_TYPE >, original::iterationStream< TYPE, DERIVED >, and original::iterator< TYPE >.
auto original::comparable< DERIVED >::operator!= | ( | const DERIVED & | other | ) | const |
Checks if the current object is not equal to another.
other | The object to compare against. |
auto original::comparable< DERIVED >::operator< | ( | const DERIVED & | other | ) | const |
Checks if the current object is less than another.
other | The object to compare against. |
auto original::comparable< DERIVED >::operator<= | ( | const DERIVED & | other | ) | const |
Checks if the current object is less than or equal to another.
other | The object to compare against. |
auto original::comparable< DERIVED >::operator== | ( | const DERIVED & | other | ) | const |
Checks if the current object is equal to another.
other | The object to compare against. |
auto original::comparable< DERIVED >::operator> | ( | const DERIVED & | other | ) | const |
Checks if the current object is greater than another.
other | The object to compare against. |
auto original::comparable< DERIVED >::operator>= | ( | const DERIVED & | other | ) | const |
Checks if the current object is greater than or equal to another.
other | The object to compare against. |