本文整理汇总了C++中Hasher::add方法的典型用法代码示例。如果您正苦于以下问题:C++ Hasher::add方法的具体用法?C++ Hasher::add怎么用?C++ Hasher::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Hasher
的用法示例。
在下文中一共展示了Hasher::add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: hash
std::size_t FunctionTypeData::hash() const {
Hasher hasher;
hasher.add(attributes());
hasher.add(returnType());
hasher.add(parameterTypes());
return hasher.get();
}
示例2: hash
size_t hash() const {
Hasher hasher;
hasher.add(kind());
switch (kind()) {
case NULLVAL:
break;
case BOOLEAN:
hasher.add(boolValue());
break;
case INTEGER:
hasher.add(integerValue());
break;
case FLOATINGPOINT:
hasher.add(floatValue());
break;
case CHARACTER:
hasher.add(characterValue());
break;
case STRING:
hasher.add(stringValue());
break;
}
return hasher.get();
}
示例3: hash
size_t Predicate::hash() const {
Hasher hasher;
hasher.add(kind());
switch (kind()) {
case TRUE:
case FALSE:
case SELFCONST:
{
break;
}
case AND:
{
hasher.add(andLeft());
hasher.add(andRight());
break;
}
case OR:
{
hasher.add(orLeft());
hasher.add(orRight());
break;
}
case SATISFIES:
{
hasher.add(satisfiesType());
hasher.add(satisfiesRequirement());
break;
}
case VARIABLE:
{
hasher.add(variableTemplateVar());
break;
}
}
return hasher.get();
}
示例4: hash
size_t Value::hash() const {
Hasher hasher;
hasher.add(kind());
hasher.add(type());
switch (kind()) {
case Value::SELF:
break;
case Value::THIS:
break;
case Value::CONSTANT:
hasher.add(constant());
break;
case Value::ALIAS:
hasher.add(&(alias()));
hasher.add(aliasTemplateArguments().size());
for (const auto& argument: aliasTemplateArguments()) {
hasher.add(argument);
}
break;
case Value::PREDICATE:
hasher.add(predicate());
break;
case Value::LOCALVAR:
hasher.add(&(localVar()));
break;
case Value::REINTERPRET:
hasher.add(reinterpretOperand());
break;
case Value::DEREF_REFERENCE:
hasher.add(derefOperand());
break;
case Value::TERNARY:
hasher.add(ternaryCondition());
hasher.add(ternaryIfTrue());
hasher.add(ternaryIfFalse());
break;
case Value::CAST:
hasher.add(castTargetType());
hasher.add(castOperand());
break;
case Value::POLYCAST:
hasher.add(polyCastTargetType());
hasher.add(polyCastOperand());
break;
case Value::INTERNALCONSTRUCT:
hasher.add(internalConstructParameters().size());
for (const auto& param: internalConstructParameters()) {
hasher.add(param);
}
break;
case Value::MEMBERACCESS:
hasher.add(memberAccessObject());
hasher.add(&(memberAccessVar()));
break;
case Value::BIND_REFERENCE:
hasher.add(bindReferenceOperand());
break;
case Value::TYPEREF:
hasher.add(typeRefType());
break;
case Value::TEMPLATEVARREF:
hasher.add(templateVar());
break;
case Value::CALL:
hasher.add(callValue());
hasher.add(callParameters().size());
for (const auto& param: callParameters()) {
hasher.add(param);
}
break;
case Value::FUNCTIONREF:
hasher.add(functionRefParentType());
hasher.add(&(functionRefFunction()));
hasher.add(functionRefTemplateArguments().size());
for (const auto& arg: functionRefTemplateArguments()) {
hasher.add(arg);
}
break;
case Value::TEMPLATEFUNCTIONREF:
hasher.add(templateFunctionRefParentType());
hasher.add(templateFunctionRefName());
hasher.add(templateFunctionRefFunctionType());
break;
case Value::METHODOBJECT:
hasher.add(methodObject());
hasher.add(methodOwner());
break;
case Value::INTERFACEMETHODOBJECT:
hasher.add(interfaceMethodObject());
hasher.add(interfaceMethodOwner());
break;
case Value::STATICINTERFACEMETHODOBJECT:
hasher.add(staticInterfaceMethodObject());
hasher.add(staticInterfaceMethodOwner());
break;
case Value::CAPABILITYTEST:
hasher.add(capabilityTestCheckType());
hasher.add(capabilityTestCapabilityType());
break;
//.........这里部分代码省略.........