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