proxygen
folly::detail::TransparentRangeHash< T > Struct Template Reference

#include <HeterogeneousAccess.h>

Public Types

using is_transparent = void
 
using folly_is_avalanching = std::true_type
 

Public Member Functions

template<typename U >
std::size_t operator() (U const &stringish) const
 
std::size_t operator() (std::string const &str) const
 

Static Private Member Functions

template<typename U >
static std::size_t hashImpl (Range< U const * > piece)
 
static std::size_t hashImpl (StringPiece piece)
 

Detailed Description

template<typename T>
struct folly::detail::TransparentRangeHash< T >

Definition at line 102 of file HeterogeneousAccess.h.

Member Typedef Documentation

template<typename T>
using folly::detail::TransparentRangeHash< T >::folly_is_avalanching = std::true_type

Definition at line 104 of file HeterogeneousAccess.h.

template<typename T>
using folly::detail::TransparentRangeHash< T >::is_transparent = void

Definition at line 103 of file HeterogeneousAccess.h.

Member Function Documentation

template<typename T>
template<typename U >
static std::size_t folly::detail::TransparentRangeHash< T >::hashImpl ( Range< U const * >  piece)
inlinestaticprivate

Definition at line 108 of file HeterogeneousAccess.h.

108  {
109  return hasher<Range<U const*>>{}(piece);
110  }
template<typename T>
static std::size_t folly::detail::TransparentRangeHash< T >::hashImpl ( StringPiece  piece)
inlinestaticprivate

Definition at line 112 of file HeterogeneousAccess.h.

112  {
113 #if defined(_GLIBCXX_STRING)
114  return std::_Hash_impl::hash(piece.begin(), piece.size());
115 #elif defined(_LIBCPP_STRING)
116  return std::__do_string_hash(piece.begin(), piece.end());
117 #else
118  return hasher<StringPiece>{}(piece);
119 #endif
120  }
template<typename T>
template<typename U >
std::size_t folly::detail::TransparentRangeHash< T >::operator() ( U const &  stringish) const
inline

Definition at line 124 of file HeterogeneousAccess.h.

124  {
125  return hashImpl(Range<T const*>{stringish});
126  }
static std::size_t hashImpl(Range< U const * > piece)
template<typename T>
std::size_t folly::detail::TransparentRangeHash< T >::operator() ( std::string const &  str) const
inline

Definition at line 137 of file HeterogeneousAccess.h.

137  {
138 #if defined(_GLIBCXX_STRING) || defined(_LIBCPP_STRING)
139  return std::hash<std::string>{}(str);
140 #else
141  return hasher<StringPiece>{}(str);
142 #endif
143  }

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