Concept checking for types that can be hashed.
More...
#include <hash.h>
template<typename DERIVED>
requires(const DERIVED& t, const DERIVED& other) {
{ t.toHash() } -> std::same_as<u_integer>;
{ t.equals(other) } -> std::same_as<bool>;
}
Concept checking for types that can be hashed.
Definition hash.h:62
Concept checking for types that can be hashed.
- Template Parameters
-
DERIVED | The type to be checked |
Requires the type to implement:
- toHash() method returning u_integer
- equals() method taking const DERIVED& and returning bool
struct MyHashable {
u_integer toHash() const noexcept {
return 42; }
bool equals(const MyHashable&) const noexcept { return true; }
};
static_assert(isHashable<MyHashable>);
std::uint32_t u_integer
32-bit unsigned integer type for sizes and indexes
Definition config.h:263