-
#include "tensorstore/util/element_pointer.h"
-
template <typename Element>
requires (!IsShared<Element>)
ElementPointer<Shared<Element>>
tensorstore::UnownedToShared(ElementPointer<Element> element_pointer); Converts a non-Shared ElementPointer to a SharedElementPointer that does not manage ownership.
The caller is responsible for ensuring that the returned SharedElementPointer is not used after the element data to which it points becomes invalid.
The returned SharedElementPointer can be copied more efficiently than a SharedElementPointer that does manage ownership, because it does not perform any atomic reference count operations.