#include "tensorstore/index_space/dimension_units.h"
absl::Status tensorstore::MergeDimensionUnits(
    
DimensionUnitsVectorexisting_units,
    
span<const std::optional<Unit>> new_units);

Merges new dimension units with existing dimension units.

The units for each dimension are merged independently.

  1. If the existing and new unit are same (either both unspecified, or both specified with the same unit), the merged unit is equal to the common unit.

  2. If the existing unit for a dimension is specified, and the new unit is not, or vice versa, the merged unit is the specified unit.

  3. It is an error two merge two distinct specified (i.e. not std::nullopt) units.