ORIGINAL
Loading...
Searching...
No Matches
original::isHashable Concept Reference

Concept checking for types that can be hashed. More...

#include <hash.h>

Concept definition

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

Detailed Description

Concept checking for types that can be hashed.

Template Parameters
DERIVEDThe type to be checked

Requires the type to implement:

struct MyHashable {
u_integer toHash() const noexcept { return 42; }
bool equals(const MyHashable&) const noexcept { return true; }
};
static_assert(isHashable<MyHashable>); // Passes
std::uint32_t u_integer
32-bit unsigned integer type for sizes and indexes
Definition config.h:263