首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

Hash

Hash是一个函数对象,其输出仅依赖于输入,并且在不同的输入值下产生相同输出的概率非常低。

所需

类型T满足Hash如果。

  • 类型T满足FunctionObject,,,CopyConstructible,,,Destructible,和给予。
  • h,类型值Tconst T,其参数类型为Key
  • k,类型可转换为Keyconst Key
  • u,一个洛值类型表达式Key

下列表达式必须有效并具有指定的效果。

Expression

Return type

Requirements

h(k)

std::size_t

the returned value depends only on the value of k for the duration of the program (since C++14) All evaluations of h(k) executed within a given execution of a program (since C++14) yield the same result for the same value of k. The probability of h(a)==h(b) for a!=b should approach 1.0/std::numeric_limits<std::size_t>::max().

h(u)

std::size_t

u is not modified

标准库

STD:哈希

*。

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com