Parasol Planning Library (PPL)
Public Types | Public Member Functions | Static Public Attributes
std::hash< std::pair< T, U > > Struct Template Reference

#include <Hash.h>

Public Types

typedef std::pair< T, U > KeyPair
 

Public Member Functions

size_t operator() (const KeyPair &_key) const noexcept
 

Static Public Attributes

static constexpr size_t magicOffset = 0x9e3779b99e3779b9
 

Detailed Description

template<typename T, typename U>
struct std::hash< std::pair< T, U > >

Define a hasher for a std::pair of elements.

Note
This implementation was borrowed from older versions of boost. I will not use the newer version because it isn't guaranteed to give the same behavior across multiple runs of a program, which is detrimental randomness that we don't need (it obfuscates our control of randomness in our sampling processes).
Tested with 100M random pairs of same type and no collisions.
Todo:
Double-check that we get similar performance with differing types.

Member Typedef Documentation

◆ KeyPair

template<typename T , typename U >
typedef std::pair<T, U> std::hash< std::pair< T, U > >::KeyPair

Member Function Documentation

◆ operator()()

template<typename T , typename U >
size_t std::hash< std::pair< T, U > >::operator() ( const KeyPair _key) const
inlinenoexcept

Field Documentation

◆ magicOffset

template<typename T , typename U >
constexpr size_t std::hash< std::pair< T, U > >::magicOffset = 0x9e3779b99e3779b9
staticconstexpr

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