|
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.
|
Unified hashing concept suite with semantic extension and ADL support. More...
Go to the source code of this file.
Classes | |
| struct | jh::hash< T, std::enable_if_t< jh::concepts::has_std_hash< T > > > |
| Case 1: std::hash<T> is valid. More... | |
| struct | jh::hash< T, std::enable_if_t<!jh::concepts::has_std_hash< T > &&jh::concepts::has_adl_hash< T > > > |
| Case 2: ADL-discovered hash(T). More... | |
| struct | jh::hash< T, std::enable_if_t<!jh::concepts::has_std_hash< T > &&!jh::concepts::has_adl_hash< T > &&jh::concepts::has_mbr_hash< T > > > |
| Case 3: Member hash(). More... | |
Namespaces | |
| namespace | jh::concepts |
| Behavioral concept namespace of the JH Toolkit. | |
Concepts | |
| concept | jh::concepts::has_std_hash |
Checks whether std::hash<T> is valid and callable. | |
| concept | jh::concepts::has_adl_hash |
Checks whether a free (ADL-discoverable) hash() function exists. | |
| concept | jh::concepts::has_mbr_hash |
Checks whether a type defines a hash() member function. | |
| concept | jh::concepts::extended_hashable |
| Concept for types that can be hashed through any supported mechanism. | |
Unified hashing concept suite with semantic extension and ADL support.
This header defines the duck-typed hashability model used by the JH framework. It generalizes hashing semantics beyond std::hash<T> by allowing user-defined and semantically meaningful hash strategies.
While std::hash<T> provides a universal entry point for associative containers, it cannot describe semantic-specific hash behaviors such as:
jh::immutable_str). jh::pod::string_view uses c_hash::fnv1a64 by default, but may switch algorithms via an enum parameter. Therefore, the JH framework permits three resolution layers:
std::hash<T>{} (highest precedence) t.hash() if provided This priority chain ensures full interoperability with the STL, while supporting domain-specific customization and lazy semantics without breaking standard containers.
1.3.x
2025