#include "tensorstore/strided_layout.h"
template <typename LayoutOrder,
         
 DimensionIndex Rank,
         
 ArrayOriginKind OriginKind>
  
requires IsContiguousLayoutOrder<LayoutOrder, Rank>
void tensorstore::InitializeContiguousLayout(
    
LayoutOrder order,
    
Index element_stride,
    
std::type_identity_t<
        
span<const Index, RankConstraint::FromInlineRank(Rank)>>
       
 shape
,
    
StridedLayout<Rank, OriginKind>layout);

Initializes *layout to a contiguous layout with the specified shape.

Parameters:
LayoutOrder order

The layout order to use.

Index element_stride

The byte stride for the last dimension if order == c_order, or for the first dimension if order == fortran_order. Typically this is equal to the size of the data type. If span(shape).size() == 0, this has no effect.

std::type_identity_t<span<const Index, RankConstraint::FromInlineRank(Rank)>> shape

The shape to assign to *layout. Must be a span with a static extent compatible with Rank and a span::value_type convertible without narrowing to Index.

out
StridedLayout<Rank, OriginKind> *layout

Layout to update. The rank will be set to std::size(shape), and any existing value is ignored.