proxygen
folly::hasher< folly::Range< T * >, std::enable_if_t< std::is_integral< T >::value, void > > Struct Template Reference

#include <Range.h>

Public Types

using folly_is_avalanching = std::true_type
 

Public Member Functions

size_t operator() (folly::Range< T * > r) const
 

Detailed Description

template<class T>
struct folly::hasher< folly::Range< T * >, std::enable_if_t< std::is_integral< T >::value, void > >

Definition at line 1491 of file Range.h.

Member Typedef Documentation

template<class T >
using folly::hasher< folly::Range< T * >, std::enable_if_t< std::is_integral< T >::value, void > >::folly_is_avalanching = std::true_type

Definition at line 1494 of file Range.h.

Member Function Documentation

template<class T >
size_t folly::hasher< folly::Range< T * >, std::enable_if_t< std::is_integral< T >::value, void > >::operator() ( folly::Range< T * >  r) const
inline

Definition at line 1496 of file Range.h.

References folly::Range< Iter >::begin(), folly::Range< Iter >::size(), and T.

1496  {
1497  // std::is_integral<T> is too restrictive, but is sufficient to
1498  // guarantee we can just hash all of the underlying bytes to get a
1499  // suitable hash of T. Something like absl::is_uniquely_represented<T>
1500  // would be better. std::is_pod is not enough, because POD types
1501  // can contain pointers and padding. Also, floating point numbers
1502  // may be == without being bit-identical.
1503  return hash::SpookyHashV2::Hash64(r.begin(), r.size() * sizeof(T), 0);
1504  }
constexpr size_type size() const
Definition: Range.h:431
folly::std T
static uint64_t Hash64(const void *message, size_t length, uint64_t seed)
Definition: SpookyHashV2.h:71
constexpr Iter begin() const
Definition: Range.h:452

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