StormByte 3.0.0
C++26 foundation of the StormByte suite
Loading...
Searching...
No Matches
StormByte::Safe::Hash< T > Struct Template Reference

Hash of an integral or enumeration value. More...

#include <StormByte/safe/hash.hxx>

Public Member Functions

STORMBYTE_FORCE_INLINE std::size_t operator() (T value) const noexcept
 Hash value.
STORMBYTE_FORCE_INLINE std::size_t operator() (T value) const noexcept
 Hash value.

Detailed Description

template<class T>
requires std::is_integral_v<T> || std::is_enum_v<T>
struct StormByte::Safe::Hash< T >

Hash of an integral or enumeration value.

Hash of a floating-point value.

Template Parameters
TIntegral or enumeration type.

The sign bit is included. Padding is not.

Template Parameters
TFloating-point type.

Member Function Documentation

◆ operator()() [1/2]

template<class T>
STORMBYTE_FORCE_INLINE std::size_t StormByte::Safe::Hash< T >::operator() ( T value) const
inlinenoexcept

Hash value.

Parameters
valueValue. A NaN is hashed as its bit pattern, not as a canonical NaN.
Returns
Hash.

◆ operator()() [2/2]

template<class T>
STORMBYTE_FORCE_INLINE std::size_t StormByte::Safe::Hash< T >::operator() ( T value) const
inlinenoexcept

Hash value.

Parameters
valueValue.
Returns
Hash.

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