template <class Policy, class = void>

struct common_policy_traits

Defined at line 33 of file ../../third_party/abseil-cpp/absl/container/internal/common_policy_traits.h

Defines how slots are initialized/destroyed/moved.

Public Methods

template <class Alloc, class... Args>
void construct (Alloc * alloc, slot_type * slot, Args &&... args)

PRECONDITION: `slot` is UNINITIALIZED

POSTCONDITION: `slot` is INITIALIZED

Defined at line 42 of file ../../third_party/abseil-cpp/absl/container/internal/common_policy_traits.h

template <class Alloc>
auto destroy (Alloc * alloc, slot_type * slot)

PRECONDITION: `slot` is INITIALIZED

POSTCONDITION: `slot` is UNINITIALIZED

Returns std::true_type in case destroy is trivial.

Defined at line 50 of file ../../third_party/abseil-cpp/absl/container/internal/common_policy_traits.h

template <class Alloc>
void transfer (Alloc * alloc, slot_type * new_slot, slot_type * old_slot)

Transfers the `old_slot` to `new_slot`. Any memory allocated by the

allocator inside `old_slot` to `new_slot` can be transferred.

OPTIONAL: defaults to:

clone(new_slot, std::move(*old_slot));

destroy(old_slot);

PRECONDITION: `new_slot` is UNINITIALIZED and `old_slot` is INITIALIZED

POSTCONDITION: `new_slot` is INITIALIZED and `old_slot` is

UNINITIALIZED

Defined at line 66 of file ../../third_party/abseil-cpp/absl/container/internal/common_policy_traits.h

template <class P = Policy>
decltype(P::element(slot)) element (absl::remove_const_t<slot_type> * slot)

PRECONDITION: `slot` is INITIALIZED

POSTCONDITION: `slot` is INITIALIZED

Note: we use remove_const_t so that the two overloads have different args

in the case of sets with explicitly const value_types.

Defined at line 75 of file ../../third_party/abseil-cpp/absl/container/internal/common_policy_traits.h

template <class P = Policy>
decltype(P::element(slot)) element (const slot_type * slot)

Defined at line 80 of file ../../third_party/abseil-cpp/absl/container/internal/common_policy_traits.h

bool transfer_uses_memcpy ()

Defined at line 84 of file ../../third_party/abseil-cpp/absl/container/internal/common_policy_traits.h

template <class Alloc>
bool destroy_is_trivial ()

Returns true if destroy is trivial and can be omitted.

Defined at line 92 of file ../../third_party/abseil-cpp/absl/container/internal/common_policy_traits.h