ORIGINAL
Loading...
Searching...
No Matches
Public Member Functions | List of all members
std::hash< T > Struct Template Reference

std::hash specialization for HashTraits types More...

#include <hash.h>

Collaboration diagram for std::hash< T >:
Collaboration graph

Public Member Functions

std::size_t operator() (const T &t) const noexcept
 Hash function operator for STL compatibility.
 

Detailed Description

template<original::HashTraits T>
struct std::hash< T >

std::hash specialization for HashTraits types

Template Parameters
TType that satisfies HashTraits concept

Provides STL compatibility for types implementing the hashable interface. Enables use of custom hashable types in std::unordered_map, std::unordered_set, etc.

Example:

class MyHashable : public original::hashable<MyHashable> {
// Implements toHash() and equals() or operator==
};
std::unordered_set<MyHashable> set; // Uses this specialization
Forward declaration of hashable interface template.
Definition hash.h:220

Member Function Documentation

◆ operator()()

template<original::HashTraits T>
std::size_t std::hash< T >::operator() ( const T &  t) const
noexcept

Hash function operator for STL compatibility.

Parameters
tThe object to hash
Returns
Hash value as std::size_t

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