proxygen
folly::AllocatorHasDefaultObjectConstruct< Alloc, T, Args > Struct Template Reference

#include <Memory.h>

Inheritance diagram for folly::AllocatorHasDefaultObjectConstruct< Alloc, T, Args >:
folly::Negation< detail::AllocatorCustomizesConstruct_< void, Alloc, T *, Args... > >

Detailed Description

template<typename Alloc, typename T, typename... Args>
struct folly::AllocatorHasDefaultObjectConstruct< Alloc, T, Args >

AllocatorHasDefaultObjectConstruct

AllocatorHasDefaultObjectConstruct<A, T, Args...> unambiguously inherits std::integral_constant<bool, V>, where V will be true iff the effect of std::allocator_traits<A>::construct(a, p, args...) is the same as new (static_cast<void*>(p)) T(args...). If true then any optimizations applicable to object construction (relying on std::is_trivially_copyable<T>, for example) can be applied to objects in an allocator-aware container using an allocation of type A.

Allocator types can override V by declaring a type alias for folly_has_default_object_construct. It is helpful to do this if you define a custom allocator type that defines a construct method, but that method doesn't do anything except call placement new.

Definition at line 710 of file Memory.h.


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