Console Library 8.0.0
A header-only library that makes C++ simple
Loading...
Searching...
No Matches
console::PairHash Struct Reference

用于 std::pair 类型的哈希函数对象。 More...

#include <collide.h>

Public Member Functions

template<typename T1, typename T2>
std::size_t operator() (std::pair< T1, T2 > p) const
 计算一对值的哈希值。

Detailed Description

用于 std::pair 类型的哈希函数对象。

该结构体为 std::pair 提供哈希支持,使得 std::unordered_map 可以 将 std::pair 作为键。哈希值通过组合两个元素的哈希值计算得出。

Member Function Documentation

◆ operator()()

template<typename T1, typename T2>
std::size_t console::PairHash::operator() ( std::pair< T1, T2 > p) const
inline

计算一对值的哈希值。

Template Parameters
T1第一个元素的类型。
T2第二个元素的类型。
Parameters
p要计算哈希值的键值对。
Returns
std::size_t 组合后的哈希值。

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