libnick 2025.9.1
A cross-platform base for native Nickvision applications.
Loading...
Searching...
No Matches
pairhash.h
Go to the documentation of this file.
1#ifndef PAIRHASH_H
2#define PAIRHASH_H
3
4#include <utility>
5#include "codehelpers.h"
6
8{
13 {
14 public:
18 PairHash() noexcept = default;
24 template <class T1, class T2>
25 size_t operator()(const std::pair<T1,T2>& p) const noexcept
26 {
27 return CodeHelpers::combineHash(std::hash<T1>()(p.first), std::hash<T2>()(p.second));
28 }
29 };
30}
31
32#endif //PAIRHASH_H
PairHash() noexcept=default
Constructs a PairHash.
size_t combineHash(size_t a, size_t b) noexcept
Combines two hash values together.
Definition cancellationtoken.h:30