microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Public Member Functions | List of all members
microfmt::hash_view< T > Class Template Reference

Non-owning view that defers a value's hash computation to formatting time. More...

#include <hash.hpp>

Public Member Functions

constexpr hash_view (const T &val RELOCO_LIFETIMEBOUND) noexcept
 Constructs a hash view referencing an existing value.
 
constexpr hash_view (const T &&)=delete
 
std::size_t compute_hash () const noexcept
 Computes the hash of the referenced value.
 

Detailed Description

template<typename T>
class microfmt::hash_view< T >

Non-owning view that defers a value's hash computation to formatting time.

Template Parameters
THashable value type.

Constructor & Destructor Documentation

◆ hash_view() [1/2]

template<typename T >
constexpr microfmt::hash_view< T >::hash_view ( const T &val  RELOCO_LIFETIMEBOUND)
inlineexplicitconstexprnoexcept

Constructs a hash view referencing an existing value.

Parameters
valValue whose std::hash result will be formatted.

◆ hash_view() [2/2]

template<typename T >
constexpr microfmt::hash_view< T >::hash_view ( const T &&  )
explicitconstexprdelete

Member Function Documentation

◆ compute_hash()

template<typename T >
std::size_t microfmt::hash_view< T >::compute_hash ( ) const
inlinenoexcept

Computes the hash of the referenced value.

Returns
Result of std::hash<T>{} applied to the stored value.

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