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
using hash_type

Public Member Functions

template<typename U>
 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_slh & operator= (with_slh const &other) noexcept=default
with_slh & operator= (with_slh &&other) noexcept=default

Public Attributes

T 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 58 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

Definition at line 60 of file with_sl.h.

◆ hash_type

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

Definition at line 61 of file with_sl.h.

Constructor & Destructor Documentation

◆ with_slh()

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

Definition at line 71 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 64 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 63 of file with_sl.h.