WPILibC++ 2024.1.1-beta-4
wpi::hash_code Class Reference

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

#include </home/runner/work/allwpilib/allwpilib/wpiutil/src/main/native/thirdparty/llvm/include/wpi/Hashing.h>

Public Member Functions

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

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. More...
 

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':

and restrictions which apply to each piece of software is included later in this file and or inside of the individual applicable source files The disclaimer of warranty in the WPILib license above applies to all code in and nothing in any of the other licenses gives permission to use the names of FIRST nor the names of the WPILib contributors to endorse or promote products derived from this software The following pieces of software have additional or alternate and or Google Inc All rights reserved Redistribution and use in source and binary with or without are permitted provided that the following conditions are this list of conditions and the following disclaimer *Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution *Neither the name of Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source code
Definition: ThirdPartyNotices.txt:110
An opaque object representing a hash code.
Definition: Hashing.h:79
friend size_t hash_value(const hash_code &code)
Allow a hash_code to be directly run through hash_value.
Definition: Hashing.h:101
std::enable_if_t< is_integral_or_enum< T >::value, hash_code > hash_value(T value)
Compute a hash_code for any integer value.
Definition: Hashing.h:648

Constructor & Destructor Documentation

◆ hash_code() [1/2]

wpi::hash_code::hash_code ( )
default

Default construct a hash_code.

Note that this leaves the value uninitialized.

◆ hash_code() [2/2]

wpi::hash_code::hash_code ( size_t  value)
inline

Form a hash code directly from a numerical value.

Member Function Documentation

◆ operator size_t()

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

Convert the hash code to its numerical value for use.

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.

◆ operator!=

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

◆ operator==

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

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