JH-Toolkit v1.4.1
An engineering-oriented C++20 toolkit with duck-typed concepts, static design, async coroutines, and semantic containers — header-only, RTTI-free, and concurrency-friendly.
Loading...
Searching...
No Matches
jh::concepts::has_adl_hash Concept Reference

Checks whether a free (ADL-discoverable) hash() function exists. More...

#include <jh/conceptual/hashable.h>

Concept definition

template<typename T>
concept has_adl_hash = requires(const T& v) {
{ hash(v) } -> std::convertible_to<size_t>;
}
Checks whether a free (ADL-discoverable) hash() function exists.
Definition hashable.h:93
Behaviorally deduced hash functor.
Definition hashable.h:158

Detailed Description

Checks whether a free (ADL-discoverable) hash() function exists.

This allows user-defined global hash functions to participate in resolution without specializing std::hash or modifying the type.

size_t hash(const MyType& t);