-
#include "tensorstore/util/element_pointer.h"
-
template <typename T, typename Element>
requires (!IsShared<Element>)
ElementPointer<Shared<Element>>
tensorstore::UnownedToShared(const std::shared_ptr<T>& owned,
ElementPointer<Element> element_pointer); Converts a non-
Shared
ElementPointer
to aSharedElementPointer
that shares ownership of the specifiedowned
pointer, in the same way as thestd::shared_ptr
aliasing constructor.The caller is responsible for ensuring that the returned
SharedElementPointer
is not used after the element data to which it points becomes invalid.