-
#include "tensorstore/util/maybe_hard_constraint.h"
- class tensorstore::MaybeHardConstraintIndex;
Combines an
Index
(which defaults tokImplicit
) with abool
indicating whether the value is a hard constraint as opposed to a default value.This type serves as a base class for option types like
ChunkLayout::ChunkElements
.Constructors¶
-
explicit MaybeHardConstraintIndex(Index value = kImplicit,
bool hard_constraint = true); Constructs from a value.
Conversion operators¶
- constexpr operator Index() const;
Implicitly converts to the
Index
value.
Methods¶
Friend functions¶
-
friend bool operator==(const MaybeHardConstraintIndex& a,
const MaybeHardConstraintIndex& b); -
friend bool operator!=(const MaybeHardConstraintIndex& a,
const MaybeHardConstraintIndex& b); Compares two constraints for equality.
Data members¶
- bool hard_constraint;
Indicates whether
value
should be treated as a hard constraint.
-
explicit MaybeHardConstraintIndex(Index value = kImplicit,