header_utils
Loading...
Searching...
No Matches
ghassanpl::with_slh< T, HASH_FUNC > Struct Template Reference

Use as a function parameter type to capture both the parameter and the hash of the call-site source location. More...

#include <with_sl.h>

Public Types

using hash_func = HASH_FUNC
 
using hash_type = decltype(HASH_FUNC{}(source_location{}))
 

Public Member Functions

template<typename U >
requires (!std::same_as<std::remove_cvref_t<U>, with_slh<T>>)
 with_slh (U &&t, hash_type loc=HASH_FUNC{}(source_location::current()))
 
 with_slh (with_slh const &other) noexcept=default
 
 with_slh (with_slh &&other) noexcept=default
 
with_slhoperator= (with_slh const &other) noexcept=default
 
with_slhoperator= (with_slh &&other) noexcept=default
 

Public Attributes

Object
 
hash_type LocationHash
 

Detailed Description

template<typename T, typename HASH_FUNC = crc64_hasher>
struct ghassanpl::with_slh< T, HASH_FUNC >

Use as a function parameter type to capture both the parameter and the hash of the call-site source location.

Template Parameters
HASH_FUNCa std::hash-style object type whose instances can hash std::source_location

Definition at line 61 of file with_sl.h.

Member Typedef Documentation

◆ hash_func

template<typename T , typename HASH_FUNC = crc64_hasher>
using ghassanpl::with_slh< T, HASH_FUNC >::hash_func = HASH_FUNC

Definition at line 63 of file with_sl.h.

◆ hash_type

template<typename T , typename HASH_FUNC = crc64_hasher>
using ghassanpl::with_slh< T, HASH_FUNC >::hash_type = decltype(HASH_FUNC{}(source_location{}))

Definition at line 64 of file with_sl.h.

Constructor & Destructor Documentation

◆ with_slh()

template<typename T , typename HASH_FUNC = crc64_hasher>
template<typename U >
requires (!std::same_as<std::remove_cvref_t<U>, with_slh<T>>)
ghassanpl::with_slh< T, HASH_FUNC >::with_slh ( U &&  t,
hash_type  loc = HASH_FUNC{}(source_location::current()) 
)
inline

Definition at line 74 of file with_sl.h.

Member Data Documentation

◆ LocationHash

template<typename T , typename HASH_FUNC = crc64_hasher>
hash_type ghassanpl::with_slh< T, HASH_FUNC >::LocationHash

Definition at line 67 of file with_sl.h.

◆ Object

template<typename T , typename HASH_FUNC = crc64_hasher>
T ghassanpl::with_slh< T, HASH_FUNC >::Object

Definition at line 66 of file with_sl.h.