folly::allocate_not_null_shared

Creates a not_null_shared_ptr using an allocator, like std::allocate_shared.

Synopsis

Declared in <folly/memory/not_null.h>

template<
    typename T,
    typename Alloc,
    typename... Args>
/* implementation-defined */
allocate_not_null_shared(
    Alloc const& alloc,
    Args&&... args);

Return Value

A not_null_shared_ptr owning the new object.

Parameters

NameDescription
allocAllocator used for the shared control block and object.
argsArguments forwarded to the constructed object.