18#ifndef itkPromoteType_h
19#define itkPromoteType_h
39template <
int VTypeEnum,
typename TA,
typename TB>
46template <
int VCharacters>
49 using Type =
char[VCharacters];
57#define ITK_ASSOCIATE(VTypeEnum, Typed) \
58 template <typename TA, typename TB> \
59 struct SizeToType<VTypeEnum, TA, TB> \
67ITK_ASSOCIATE(3,
short);
68ITK_ASSOCIATE(4,
unsigned short);
70ITK_ASSOCIATE(6,
unsigned int);
71ITK_ASSOCIATE(7,
long);
72ITK_ASSOCIATE(8,
unsigned long);
73ITK_ASSOCIATE(9,
long long);
74ITK_ASSOCIATE(10,
unsigned long long);
75ITK_ASSOCIATE(11,
float);
76ITK_ASSOCIATE(12,
double);
77ITK_ASSOCIATE(13,
long double);
102template <
typename TA,
typename TB>
109 template <
typename T>
110 static Details::Identity<1>::Type & Check(
typename Details::SizeToType<1, TA, TB>::Type, T);
111 template <
typename T>
112 static Details::Identity<2>::Type & Check(
typename Details::SizeToType<2, TA, TB>::Type, T);
115 static Details::Identity<3>::Type &
116 Check(
typename Details::SizeToType<3, TA, TB>::Type,
int);
117 static Details::Identity<4>::Type &
118 Check(
typename Details::SizeToType<4, TA, TB>::Type,
int);
119 static Details::Identity<5>::Type &
120 Check(
typename Details::SizeToType<5, TA, TB>::Type,
int);
121 static Details::Identity<6>::Type &
122 Check(
typename Details::SizeToType<6, TA, TB>::Type,
int);
123 static Details::Identity<7>::Type &
124 Check(
typename Details::SizeToType<7, TA, TB>::Type,
int);
125 static Details::Identity<8>::Type &
126 Check(
typename Details::SizeToType<8, TA, TB>::Type,
int);
127 static Details::Identity<9>::Type &
128 Check(
typename Details::SizeToType<9, TA, TB>::Type,
int);
129 static Details::Identity<10>::Type &
130 Check(
typename Details::SizeToType<10, TA, TB>::Type,
int);
131 static Details::Identity<11>::Type &
132 Check(
typename Details::SizeToType<11, TA, TB>::Type,
int);
133 static Details::Identity<12>::Type &
134 Check(
typename Details::SizeToType<12, TA, TB>::Type,
int);
135 static Details::Identity<13>::Type &
136 Check(
typename Details::SizeToType<13, TA, TB>::Type,
int);
154 using Type =
typename Details::SizeToType<
sizeof Check(a + b, 0), TA, TB>::Type;