15 #ifndef ABSL_CONTAINER_INTERNAL_HASH_POLICY_TRAITS_H_ 16 #define ABSL_CONTAINER_INTERNAL_HASH_POLICY_TRAITS_H_ 20 #include <type_traits> 26 namespace container_internal {
29 template <
class Policy,
class =
void>
37 template <
class Key,
class... Args>
39 return std::forward<Key>(k);
43 template <
class P = Policy,
class =
void>
48 : P::constant_iterators {};
63 using pointer =
typename std::remove_reference<reference>::type*;
64 using value_type =
typename std::remove_reference<reference>::type;
74 template <
class Alloc,
class... Args>
81 template <
class Alloc>
97 template <
class Alloc>
104 template <
class P = Policy>
115 template <
class P = Policy>
117 return P::space_used(slot);
149 template <
class F,
class... Ts,
class P = Policy>
150 static auto apply(F&& f, Ts&&... ts)
151 -> decltype(
P::apply(std::forward<F>(f), std::forward<Ts>(ts)...)) {
152 return P::apply(std::forward<F>(f), std::forward<Ts>(ts)...);
157 template <
class P = Policy>
165 template <
class T,
class P = Policy>
172 template <
class Alloc,
class P = Policy>
178 template <
class Alloc>
189 #endif // ABSL_CONTAINER_INTERNAL_HASH_POLICY_TRAITS_H_ typename Policy::init_type init_type
static std::function< Slot &(Slot *)> element
static size_t space_used(const slot_type *slot)
decltype(Policy::element(std::declval< slot_type * >())) reference
static auto key(slot_type *slot) -> decltype(P::apply(ReturnKey(), element(slot)))
static void transfer(Alloc *alloc, slot_type *new_slot, slot_type *old_slot)
Key operator()(Key &&k, const Args &...) const
static auto transfer_impl(Alloc *alloc, slot_type *new_slot, slot_type *old_slot, int) -> decltype((void) P::transfer(alloc, new_slot, old_slot))
static std::function< void(void *, Slot *)> destroy
typename Policy::key_type key_type
static void transfer_impl(Alloc *alloc, slot_type *new_slot, slot_type *old_slot, char)
static auto value(T *elem) -> decltype(P::value(elem))
static std::function< void(void *, Slot *, Slot *)> transfer
static std::function< void(void *, Slot *, Slot)> construct
typename type_traits_internal::VoidTImpl< Ts... >::type void_t
static auto apply(F &&f, Ts &&...ts) -> decltype(P::apply(std::forward< F >(f), std::forward< Ts >(ts)...))
static void construct(Alloc *alloc, slot_type *slot, Args &&...args)
typename std::remove_reference< reference >::type value_type
std::allocator< int > alloc
constexpr absl::remove_reference_t< T > && move(T &&t) noexcept
MockFunction< int(int)> apply
typename Policy::slot_type slot_type
static void destroy(Alloc *alloc, slot_type *slot)
typename std::remove_reference< reference >::type * pointer
static auto element(slot_type *slot) -> decltype(P::element(slot))