#include "tensorstore/index_space/index_domain.h"
template <DimensionIndex OtherRank>
  
requires (RankConstraint::EqualOrUnspecified(OtherRank, Rank))
friend Result<IndexDomain<RankConstraint::And(Rank, OtherRank)>>
tensorstore::IndexDomain<Rank, CKind>::ApplyIndexTransform(
    
BoxView<OtherRank> box,
    
IndexDomain domain);

Restricts an index domain by a box of the same rank.

This is normally invoked via the pipeline operator:

TENSORSTORE_ASSIGN_OR_RETURN(auto new_domain, domain | box);

The resultant index domain has the explicit bounds given by box, but preserves the labels of domain.

Requires:

The static rank of box must be compatible with the static rank of domain.

Parameters:
BoxView<OtherRank> box

The box to apply.

IndexDomain domain

The existing index domain to restrict.

Error absl::StatusCode::kInvalidArgument:

if box.rank() is not equal to domain.rank().

Error absl::StatusCode::kInvalidArgument:

if box is not contained within the explicit bounds of domain.