copy_to_unique_ptr

Synopsis

Declared in <folly/Memory.h>

template<typename T>
std::unique_ptr<remove_cvref_t<T>>
copy_to_unique_ptr(T&& t);

Description

Move or copy the argument to the heap and return it owned by a unique_ptr.

Like std::make_unique, but deduces the type of the owned object.

Return Value

a unique_ptr owning the heap‐allocated object

Parameters

Name

Description

t

the object to move or copy to the heap

Created with MrDocs