proxygen
|
#include <Memory.h>
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.