#include "tensorstore/array.h"
template <typename Element = void,
         
 typename Extents,
         
 typename LayoutOrder = ContiguousLayoutOrder>
auto tensorstore::AllocateArray(
    
const Extentsextents,
    
LayoutOrder layout_order = ContiguousLayoutOrder::c,
    
ElementInitialization initialization = default_init,
    
dtype_t<Element> dtype = dtype_v<Element>);
template <typename Element = void,
         
 typename BoxType,
         
 typename LayoutOrder = ContiguousLayoutOrder>
  
requires IsBoxLike<BoxType> &&
          
 IsContiguousLayoutOrder<LayoutOrder, BoxType::static_rank>
SharedArray<Element, BoxType::static_rank, offset_origin>
tensorstore::AllocateArray(
    
const BoxTypedomain,
    
LayoutOrder layout_order = ContiguousLayoutOrder::c,
    
ElementInitialization initialization = default_init,
    
dtype_t<Element> dtype = dtype_v<Element>);

Allocates a contiguous array of the specified shape/domain and type.

The elements are constructed and initialized as specified by initialization.

Template Parameters:
typename Element = void

Optional. Specifies the element type of the array. If not specified (or if void is specified), the element type must be specified at run time using the dtype parameter.

Parameters:
const Extents &extents

A span-compatible array specifying the shape of the array. The element type of extents must be convertible without narrowing to Index. May also be specified as a braced list, e.g. {200, 300}.

const BoxType &domain

The domain of the array.

LayoutOrder layout_order = ContiguousLayoutOrder::c

Optional. The layout order of the allocated array. Defaults to ContiguousLayoutOrder::c.

ElementInitialization initialization = default_init

Optional. Specifies the form of initialization to use.

dtype_t<Element> dtype = dtype_v<Element>

Optional. Specifies the element type at run time. Must be specified if Element is void.