LLVM 19.0.0git
Public Member Functions | Friends | List of all members
llvm::hash_code Class Reference

An opaque object representing a hash code. More...

#include "llvm/ADT/Hashing.h"

Public Member Functions

 hash_code ()=default
 Default construct a hash_code.
 
 hash_code (size_t value)
 Form a hash code directly from a numerical value.
 
 operator size_t () const
 Convert the hash code to its numerical value for use.
 

Friends

bool operator== (const hash_code &lhs, const hash_code &rhs)
 
bool operator!= (const hash_code &lhs, const hash_code &rhs)
 
size_t hash_value (const hash_code &code)
 Allow a hash_code to be directly run through hash_value.
 

Detailed Description

An opaque object representing a hash code.

This object represents the result of hashing some entity. It is intended to be used to implement hashtables or other hashing-based data structures. While it wraps and exposes a numeric value, this value should not be trusted to be stable or predictable across processes or executions.

In order to obtain the hash_code for an object 'x':

An opaque object representing a hash code.
Definition: Hashing.h:74
friend size_t hash_value(const hash_code &code)
Allow a hash_code to be directly run through hash_value.
Definition: Hashing.h:96
hash_code hash_value(const FixedPointSemantics &Val)
Definition: APFixedPoint.h:128

Definition at line 74 of file Hashing.h.

Constructor & Destructor Documentation

◆ hash_code() [1/2]

llvm::hash_code::hash_code ( )
default

Default construct a hash_code.

Note that this leaves the value uninitialized.

◆ hash_code() [2/2]

llvm::hash_code::hash_code ( size_t  value)
inline

Form a hash code directly from a numerical value.

Definition at line 83 of file Hashing.h.

References value.

Member Function Documentation

◆ operator size_t()

llvm::hash_code::operator size_t ( ) const
inline

Convert the hash code to its numerical value for use.

Definition at line 86 of file Hashing.h.

References value.

Friends And Related Function Documentation

◆ hash_value

size_t hash_value ( const hash_code code)
friend

Allow a hash_code to be directly run through hash_value.

Definition at line 96 of file Hashing.h.

◆ operator!=

bool operator!= ( const hash_code lhs,
const hash_code rhs 
)
friend

Definition at line 91 of file Hashing.h.

◆ operator==

bool operator== ( const hash_code lhs,
const hash_code rhs 
)
friend

Definition at line 88 of file Hashing.h.


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