ORIGINAL
|
Interface for objects that can be compared. More...
Go to the source code of this file.
Classes | |
class | original::comparable< DERIVED > |
Base class for comparable objects. More... | |
Namespaces | |
namespace | original |
Main namespace for the project Original. | |
Functions | |
template<original::CmpTraits T> | |
std::strong_ordering | operator<=> (const T &lhs, const T &rhs) |
Three-way comparison operator for CmpTraits types. | |
Interface for objects that can be compared.
Defines an interface for comparing instances of derived classes. Derived classes must implement compareTo()
to provide comparison logic. Provides common comparison operators for convenience.
std::strong_ordering operator<=> | ( | const T & | lhs, |
const T & | rhs | ||
) |
Three-way comparison operator for CmpTraits types.
T | Type satisfying CmpTraits concept |
lhs | Left-hand side object |
rhs | Right-hand side object |
Provides C++20 spaceship operator support for types implementing the comparable interface. Enables modern comparison syntax.
Example: