#include "tensorstore/util/extents.h"
template <typename T, ptrdiff_t Extent>
T tensorstore::ProductOfExtents(span<T, Extent> s);

Computes the product of the elements of the given span.

Parameters:
span<T, Extent> s

A contiguous sequence of numbers to multiply.

Dchecks:

All elements of s are non-negative.

Returns:

s[0] * ... * s[s.size()-1], or 1 if s.empty(), or std::numeric_limits<T>::max() if integer overflow occurs. However, if any element is 0, the return value is guaranteed to be 0, even if overflow occurred in computing an intermediate product.