-
#include "tensorstore/rank.h" -
template <DimensionIndex Rank>
requires (Rank >= 0)
using tensorstore::StaticRank =
std::integral_constant<DimensionIndex, Rank>; Template alias that evaluates to the type used for representing a static rank.
This results in a substitution failure if
Rank < 0(in particular, ifRank == dynamic_rank).If this is used to specify a default value for a function parameter, e.g.:
StaticOrDynamicRank<Rank> rank = StaticRank<Rank>(), the effect is that the parameter is required ifRank == dynamic_rank, but optional otherwise.