proxygen
folly::AllocatorHasDefaultObjectDestroy< Alloc, T > Struct Template Reference

#include <Memory.h>

Inheritance diagram for folly::AllocatorHasDefaultObjectDestroy< Alloc, T >:
folly::Negation< detail::AllocatorCustomizesDestroy_< void, Alloc, T * > >

Detailed Description

template<typename Alloc, typename T>
struct folly::AllocatorHasDefaultObjectDestroy< Alloc, T >

AllocatorHasDefaultObjectDestroy

AllocatorHasDefaultObjectDestroy<A, T> unambiguously inherits std::integral_constant<bool, V>, where V will be true iff the effect of std::allocator_traits<A>::destroy(a, p) is the same as p->~T(). If true then optimizations applicable to object destruction (relying on std::is_trivially_destructible<T>, for example) can be applied to objects in an allocator-aware container using an allocator of type A.

Allocator types can override V by declaring a type alias for folly_has_default_object_destroy. It is helpful to do this if you define a custom allocator type that defines a destroy method, but that method doesn't do anything except call the object's destructor.

Definition at line 734 of file Memory.h.


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