#include "tensorstore/index_space/transformed_array.h"
template <typename Element,
         
 DimensionIndex Rank,
         
 ContainerKind LayoutCKind>
  
requires (!IsShared<Element>)
TransformedArray<Shared<Element>, Rank, LayoutCKind>
tensorstore::UnownedToShared(
    
TransformedArray<Element, Rank, LayoutCKind> array);
template <typename T,
         
 typename Element,
         
 DimensionIndex Rank,
         
 ContainerKind LayoutCKind>
  
requires (!IsShared<Element>)
TransformedArray<Shared<Element>, Rank, LayoutCKind>
tensorstore::UnownedToShared(
    
const std::shared_ptr<T>owned,
    
TransformedArray<Element, Rank, LayoutCKind> array);
template <typename Element,
         
 DimensionIndex Rank,
         
 ContainerKind LayoutCKind>
TransformedArray<Shared<Element>, Rank, LayoutCKind>
tensorstore::UnownedToShared(
    
TransformedArray<Shared<Element>, Rank, LayoutCKind> array);

Converts an arbitrary TransformedArray to a TransformedSharedArray.

Warning

The caller is responsible for ensuring that the returned array is not used after the element data to which it points becomes invalid.

Parameters:
const std::shared_ptr<T> &owned

If specified, the returned array shares ownership with the owned pointer, in the same way as the std::shared_ptr aliasing constructor. Cannot be specified if array is already a TransformedSharedArray.

TransformedArray<Element, Rank, LayoutCKind> array
TransformedArray<Shared<Element>, Rank, LayoutCKind> array

Existing array to return. If array is already a TransformedSharedArray, it is simply returned as is, i.e. the returned array shares ownership with array.