30template <
typename DERIVED>
54 template<
typename EXTENDED>
55 friend std::strong_ordering
operator<=>(
const EXTENDED& lc,
const EXTENDED& rc);
107template<
typename EXTENDED>
108std::strong_ordering
operator<=>(
const EXTENDED& lc,
const EXTENDED& rc) {
109 return lc.compareTo(rc) <=> 0;
112template<
typename DERIVED>
114 return compareTo(other) == 0;
117template<
typename DERIVED>
119 return compareTo(other) != 0;
122template<
typename DERIVED>
124 return compareTo(other) < 0;
127template<
typename DERIVED>
129 return compareTo(other) > 0;
132template<
typename DERIVED>
134 return compareTo(other) <= 0;
137template<
typename DERIVED>
139 return compareTo(other) >= 0;
Base class for comparable objects.
Definition comparable.h:31
bool operator<=(const DERIVED &other) const
Checks if the current object is less than or equal to another.
Definition comparable.h:133
bool operator!=(const DERIVED &other) const
Checks if the current object is not equal to another.
Definition comparable.h:118
bool operator>=(const DERIVED &other) const
Checks if the current object is greater than or equal to another.
Definition comparable.h:138
virtual integer compareTo(const DERIVED &other) const =0
Compares the current object with another of the same type.
friend std::strong_ordering operator<=>(const EXTENDED &lc, const EXTENDED &rc)
Three-way comparison operator (<=>), returns an ordered comparison result.
Definition comparable.h:108
bool operator==(const DERIVED &other) const
Checks if the current object is equal to another.
Definition comparable.h:113
virtual ~comparable()=default
Virtual destructor for proper cleanup of derived objects.
bool operator>(const DERIVED &other) const
Checks if the current object is greater than another.
Definition comparable.h:128
bool operator<(const DERIVED &other) const
Checks if the current object is less than another.
Definition comparable.h:123
Platform-independent type definitions and compiler/platform detection.
std::int64_t integer
64-bit signed integer type for arithmetic operations
Definition config.h:254
Main namespace for the project Original.
Definition algorithms.h:21
std::strong_ordering operator<=>(const EXTENDED &lc, const EXTENDED &rc)
Definition comparable.h:108