Maestro
0.1.0
Unified interface for quantum circuit simulation
Loading...
Searching...
No Matches
PairHash.h
Go to the documentation of this file.
1
11
#pragma once
12
13
#ifndef _PAIR_HASH_H_
14
#define _PAIR_HASH_H_
15
16
namespace
Utils
{
17
18
// or simply use boost::hash
19
template
<
typename
T1,
typename
T2 = T1>
20
class
PairHash
{
21
public
:
22
size_t
operator()
(
const
std::pair<T1, T2> &p)
const
{
23
const
auto
h1 = std::hash<T1>{}(p.first);
24
const
auto
h2 = std::hash<T2>{}(p.second);
25
26
// alternative with boost combine:
27
/*
28
std::size_t seed = 0;
29
boost::hash_combine(seed, h1);
30
boost::hash_combine(seed, h1);
31
32
return seed;
33
*/
34
35
return
(h1 << 5) ^ h2;
36
}
37
};
38
39
}
// namespace Utils
40
41
#endif
Utils::PairHash
Definition
PairHash.h:20
Utils::PairHash::operator()
size_t operator()(const std::pair< T1, T2 > &p) const
Definition
PairHash.h:22
Utils
Definition
Alias.h:20
Utils
PairHash.h
Generated on Thu Feb 12 2026 15:14:57 for Maestro by
1.9.8