ORIGINAL
Loading...
Searching...
No Matches
Public Member Functions | List of all members
original::hashable< DERIVED > Class Template Referenceabstract

Forward declaration of hashable interface template. More...

#include <hash.h>

Inheritance diagram for original::hashable< DERIVED >:
Inheritance graph
Collaboration diagram for original::hashable< DERIVED >:
Collaboration graph

Public Member Functions

virtual u_integer toHash () const noexcept
 Computes the hash of the object.
 
virtual bool equals (const DERIVED &other) const noexcept
 Compares two objects for equality.
 
virtual ~hashable ()=0
 Virtual destructor.
 

Detailed Description

template<typename DERIVED>
class original::hashable< DERIVED >

Forward declaration of hashable interface template.

Interface for user-defined hashable types.

Template Parameters
DERIVEDThe derived class that inherits from hashable.
DERIVEDThe derived type (CRTP pattern)

Provides default implementations for:

Usage Example:

class MyType : public hashable<MyType> {
public:
bool operator==(const MyType&) const { return true; }
// Optionally override toHash() and equals()
};
Forward declaration of hashable interface template.
Definition hash.h:240
bool operator==(const autoPtr< T, DER, DEL > &ptr, const std::nullptr_t &null)
Equality comparison with nullptr.
Definition autoPtr.h:622

Constructor & Destructor Documentation

◆ ~hashable()

template<typename DERIVED >
original::hashable< DERIVED >::~hashable ( )
pure virtualdefault

Virtual destructor.

Note
Required for proper polymorphic behavior

Member Function Documentation

◆ equals()

template<typename DERIVED >
bool original::hashable< DERIVED >::equals ( const DERIVED &  other) const
virtualnoexcept

Compares two objects for equality.

Parameters
otherThe object to compare with
Returns
True if equal

Default implementation uses operator==

◆ toHash()

template<typename DERIVED >
original::u_integer original::hashable< DERIVED >::toHash ( ) const
virtualnoexcept

The documentation for this class was generated from the following file: