dice-hash
Hash function for stl types and container
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
dice::hash::DiceHash< T, Policy > Struct Template Reference

Wrapper class for the dice::hash::dice_hash function. More...

#include <DiceHash.hpp>

Inheritance diagram for dice::hash::DiceHash< T, Policy >:
Inheritance graph
[legend]
Collaboration diagram for dice::hash::DiceHash< T, Policy >:
Collaboration graph
[legend]

Public Member Functions

std::size_t operator() (T const &t) const noexcept
 Overloaded operator to calculate a hash.
 

Static Public Member Functions

static constexpr bool is_faulty (std::size_t to_check) noexcept
 Function to check if a hash is equal to an error value.
 

Detailed Description

template<typename T, Policies::HashPolicy Policy = Policies::Martinus>
struct dice::hash::DiceHash< T, Policy >

Wrapper class for the dice::hash::dice_hash function.

It is a typical hash interface.

Template Parameters
TThe type to define the hash for.
PolicyThe Policy defines how the hash works on a basic level.

Member Function Documentation

◆ is_faulty()

template<typename T , Policies::HashPolicy Policy = Policies::Martinus>
static constexpr bool dice::hash::DiceHash< T, Policy >::is_faulty ( std::size_t  to_check)
inlinestaticconstexprnoexcept

Function to check if a hash is equal to an error value.

Simple wrapper for equality checking of the Policy error value.

Parameters
to_checkThe hash value to check.
Returns
True if value is an error value, false otherwise.

◆ operator()()

template<typename T , Policies::HashPolicy Policy = Policies::Martinus>
std::size_t dice::hash::DiceHash< T, Policy >::operator() ( T const t) const
inlinenoexcept

Overloaded operator to calculate a hash.

Simply calls the dice_hash function for the specified type.

Parameters
tThe value to calculate the hash of.
Returns
Hash value.

The documentation for this struct was generated from the following file: