#include "tensorstore/data_type.h"
enum class tensorstore::DataTypeConversionFlags;

Specifies traits for the conversion from one data type to another.

enumerator kSupported = 1;

Conversion is possible. If not set, no other flags should be specified.

enumerator kCanReinterpretCast = 2;

The conversion requires no change to the in-memory representation. (i.e. conversion from intN_t -> uintN_t and vice versa).

enumerator kSafeAndImplicit = 4;

The conversion is guaranteed to succeed without any loss of information. These conversions are performed implicitly when needed. Examples include float64 -> float32, int32 -> int16, int32 -> uint16, float32 -> complex64. As a special case, conversions from numeric to string types are not marked safe even though there is no loss of information, in order to prevent this implicit conversion.

enumerator kIdentity = 8;

Conversion is from a given data type to itself (i.e. no conversion).

constexpr bool tensorstore::operator!(DataTypeConversionFlags x);

Checks if any flags are set.

constexpr DataTypeConversionFlags
tensorstore::operator|(DataTypeConversionFlags a,
                       
DataTypeConversionFlags b);

Computes the union of the flag sets.

constexpr DataTypeConversionFlags
tensorstore::operator~(DataTypeConversionFlags x);

Computes the complement of the flag set.

constexpr DataTypeConversionFlags
tensorstore::operator&(DataTypeConversionFlags a,
                       
DataTypeConversionFlags b);

Computes the intersection of the flag sets.