folly::copy_through_shared_ptr

copy_through_shared_ptr

Synopsis

Declared in <folly/Memory.h>

template<typename T>
std::shared_ptr<T>
copy_through_shared_ptr(std::shared_ptr<T> const& t);

Description

If the argument is nonnull, allocates a copy of its pointee.

Return Value

a shared_ptr owning the copy, or null if t is null

Parameters

NameDescription
tthe shared_ptr whose pointee is copied