-
#include "tensorstore/data_type.h" -
template <typename T>
using tensorstore::CanonicalElementType; Metafunction that maps an unqualified type
Tto the equivalent canonical element type, if there is one.If
Tis an integer type ofNequal to 8, 16, 32, or 64 bits, the equivalent canonical element type isintN_t(ifTis signed) oruintN_t(ifTis unsigned). Otherwise, the canonical element type isT.On all common platforms:
signed char == int8_t short == int16_t int == int32_tHowever,
longmay be 32-bit (all 32-bit platforms, and 64-bit Windows) or 64-bit (Linux/Mac OS X 64-bit).The
long longtype is always 64-bit.Therefore, depending on the platform, either
intandlongare distinct types of the same size, orlongandlong longare distinct types of the same size.TensorStore data types are defined by size, but also have a corresponding canonical C++ type. In order to allow
int,long,long longto be used with TensorStore, this metafunction is used to ensure that non-canonical types (longiflongis 32-bit,long longiflongis 64-bit) map to the same TensorStoreDataTypeas the corresponding canonical type.