#include "tensorstore/index_space/index_vector_or_scalar.h"
template <typename T>
struct tensorstore::IsIndexVectorOrScalar;

A type T satisfies the IsIndexVectorOrScalar concept if it is either:

  1. convertible without narrowing to Index (scalar), in which case the nested extent constant equals dynamic_rank and the nested normalized_type alias equals Index; or

  2. compatible with span with a span::value_type of Index (vector), in which case the nested normalized_type alias is equal to the result type of span, and the nested extent constant is equal to the span::extent of normalized_type.

If T satisfies the IsIndexVectorOrScalar concept, this metafunction has defines a nested value member equal to true, as well as nested extent and normalized_type members. Otherwise, this metafunction defines a nested value member equal to false, and no nested normalized_type or extent members.

This concept is used to constrain the parameter types of some methods of DimExpression.

Data members

constexpr const bool value;

Indicates whether T satisfies the concept.

constexpr const DimensionIndex extent = -1;

Compile-time length of the vector, or dynamic_rank if T represents a scalar or the length is specified at run time.

Types

using normalized_type = void;

Normalized scalar/vector type, equal to Index or span<Index, extent>.