M
Marcin Kalicinski
Are 3 types: signed char, char and unsigned char distinct? My compiler is
treating char as signed char (i.e. it has sign, and range from -128 to 127),
but the following code does not call f<char> as I would expect:
template<class T> void f(T t)
{
}
template<> void f<char>(char t)
{
}
int main()
{
signed char ch = 0;
f(ch); // <-- this calls the unspecialized version
}
Do I have to provide specializations for unqualified char and both signed
and unsigned chars? How about ints, shorts and longs?
Marcin
treating char as signed char (i.e. it has sign, and range from -128 to 127),
but the following code does not call f<char> as I would expect:
template<class T> void f(T t)
{
}
template<> void f<char>(char t)
{
}
int main()
{
signed char ch = 0;
f(ch); // <-- this calls the unspecialized version
}
Do I have to provide specializations for unqualified char and both signed
and unsigned chars? How about ints, shorts and longs?
Marcin