#include "tensorstore/index_space/dim_expression.h"
template <typename Labels>
auto tensorstore::DimExpression<Op...>::Label(
    
const Labelslabels) const;
template <typename... L>
auto tensorstore::DimExpression<Op...>::Label(
    
const L&... labels) const;

Sets (or changes) the labels of the selected dimensions.

The new dimension selection is the same as the prior dimension selection, with a static rank equal to the merged static rank of the prior dimension selection and the static rank of the labels vector.

For example: Dims(0, 2).Label({"a", "b"}) has the following effects:

Before

After

Dimension selection

{0, 2}

{0, 2}

Input domain

[1, 3], [2, 5], [3, 4]

[1, 3], [2, 5], [3, 4]

Labels

{"x", "y", "z"}

{"a", "y", "b"}

Requires:

Labels is span-compatible with a span::value_type of std::string, std::string_view, or const char*, and a static extent compatible with the static rank of the dimension selection.

Parameters:
const Labels &labels
const L&... labels

The new labels for each of the selected dimensions. May be a braced list, e.g. Label({"a", "b"}). May also be specified as an argument pack, e.g. Label("a", "b", "c").

Error absl::StatusCode::kInvalidArgument:

if the extent of the labels vector is equal to the number of selected dimensions.