PairHasher< Int1, Int2 > Struct Template Reference

A hashing function-object for pairs of ints. More...

#include <stl-utils.h>

Public Member Functions

size_t operator() (const std::pair< Int1, Int2 > &x) const noexcept
 
 PairHasher ()
 

Detailed Description

template<typename Int1, typename Int2 = Int1>
struct kaldi::PairHasher< Int1, Int2 >

A hashing function-object for pairs of ints.

Definition at line 235 of file stl-utils.h.

Constructor & Destructor Documentation

◆ PairHasher()

PairHasher ( )
inline

Definition at line 240 of file stl-utils.h.

References KALDI_ASSERT_IS_INTEGER_TYPE.

240  { // Check we're instantiated with an integer type.
243  }
#define KALDI_ASSERT_IS_INTEGER_TYPE(I)
Definition: kaldi-utils.h:133

Member Function Documentation

◆ operator()()

size_t operator() ( const std::pair< Int1, Int2 > &  x) const
inlinenoexcept

Definition at line 236 of file stl-utils.h.

236  {
237  // 7853 was chosen at random from a list of primes.
238  return x.first + x.second * 7853;
239  }

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