ttg 1.0.0
Template Task Graph (TTG): flowgraph-based programming model for high-performance distributed-memory algorithms
Loading...
Searching...
No Matches
pair.h
Go to the documentation of this file.
1// SPDX-License-Identifier: BSD-3-Clause
2#ifndef TTG_UTIL_HASH_STD_PAIR_H
3#define TTG_UTIL_HASH_STD_PAIR_H
4
5#include "ttg/util/hash.h"
6
7#include <utility>
8
9namespace ttg::overload {
10
11 template <typename T1, typename T2>
12 struct hash<std::pair<T1, T2>,
13 std::enable_if_t<meta::has_ttg_hash_specialization_v<T1> && meta::has_ttg_hash_specialization_v<T2>>> {
14 auto operator()(const std::pair<T1, T2>& t) const {
15 std::size_t seed = 0;
16 hash_combine(seed, t.first);
17 hash_combine(seed, t.second);
18 return seed;
19 }
20 };
21
22} // namespace ttg::overload
23
24#endif // TTG_UTIL_HASH_PAIR_H
STL namespace.
place for overloading/instantiating hash and other functionality
Definition hash.h:75
void hash_combine(std::size_t &seed, T const &v)
Definition hash.h:148
Computes hash values for objects of type T.
Definition hash.h:82