yorel::yomm2::policy::checked_perfect_hash
defined in <yorel/yomm2/policy.hpp>, also provided by <yorel/yomm2/core.hpp>, <yorel/yomm2/keywords.hpp>
template<class Policy>
struct checked_perfect_hash;
checked_perfect_hash is a subclass of fast_perfect_hash. It checks
that the id passed to hash_type_index is valid, i.e. was in the set of ids
registered via hash_initialize.
Policy - the policy containing the facet.
| Name | Description |
|---|---|
| hash_initialize | finds a hash function |
| hash_type_id | returns the hashed type_id |
template<class Policy>
template <typename ForwardIterator>
static size_t hash_initialize(ForwardIterator first, ForwardIterator last)
Calls
fast_perfect_hash::hash_initialize.
Also build a reverse mapping, from hashed ids to registered ids.
first, last - a range of type_ids
None.
template<class Policy>
static type_id hash_type_id(type_id type)
Retrieve the registered id corresponding to the hashed id. Compare it with
type. If they are the same, return the hashed value. If not, report an error
via Policy::error if Policy has an error_handler facet; otherwise,
abort the program.
type - a type_id
None.
unknown_class_error, with context set to unknown_class_error::update.error_handler - to report error conditions.error_output - for diagnostics.trace_output - for trace.