sandbox
Loading...
Searching...
No Matches
hash.hpp File Reference
#include <utility>
#include <string>
#include <string_view>
#include <iostream>
#include <concepts>
#include <cinttypes>

Go to the source code of this file.

Classes

struct  sbx::utility::fnv1a_traits< std::uint32_t >
 Traits for the fnv1a hash function specialized for 32-bit hashes. More...
 
struct  sbx::utility::fnv1a_traits< std::uint64_t >
 Traits for the fnv1a hash function specialized for 64-bit hashes. More...
 
struct  sbx::utility::fnv1a_hash< Char, Hash, HashTraits >
 Functor that implements the fnv1a hash algorithm. More...
 

Concepts

concept  sbx::utility::hashable
 A concept that represents a type that can be hashed.
 
concept  sbx::utility::character
 A concept that represents a character type.
 

Functions

constexpr auto sbx::utility::hash_combine (std::size_t &seed) -> void
 Combines multiple hashes into a single hash.
 
template<hashable Type, hashable... Rest>
constexpr auto sbx::utility::hash_combine (std::size_t &seed, const Type &value, Rest... rest) -> void
 Combines multiple hashes into a single hash. More...
 

Function Documentation

◆ hash_combine()

template<hashable Type, hashable... Rest>
constexpr auto sbx::utility::hash_combine ( std::size_t &  seed,
const Type &  value,
Rest...  rest 
) -> void
inlineconstexpr

Combines multiple hashes into a single hash.

Template Parameters
TypeThe type of the first value to hash.
RestThe types of the remaining values to hash.
Parameters
seedThe seed to combine the hashes with.
valueThe first value to hash.
restThe remaining values to hash.