#include "tensorstore/index_interval.h"
constexpr Index tensorstore::IndexInterval::size() const;

Returns the size of the interval.

If inclusive_min() == -kInfIndex and inclusive_max() == +kInfIndex, this returns kInfSize (as might be expected). However, if inclusive_min() == -kInfIndex and inclusive_max() < +kInfIndex, or inclusive_min() > -kInfIndex and inclusive_max() == +kInfIndex, this returns a value less than kInfSize, even though the size is still logically unbounded.

Invariant:

size() >= 0 && size() <= kInfSize

Invariant:

inclusive_min() + size() == exclusive_max()