PDA

View Full Version : what's this template meaning in qglobal.h?



jerry7
19th September 2010, 01:51
hi, When i read the qglobal.h, and i can't understander these template meaning. Can a template be specializition by a numeric ? And where is greneric version of QIntegerForSize?

thanks!


template <int> struct QIntegerForSize;
template <> struct QIntegerForSize<1> { typedef quint8 Unsigned; typedef qint8 Signed; };
template <> struct QIntegerForSize<2> { typedef quint16 Unsigned; typedef qint16 Signed; };
template <> struct QIntegerForSize<4> { typedef quint32 Unsigned; typedef qint32 Signed; };
template <> struct QIntegerForSize<8> { typedef quint64 Unsigned; typedef qint64 Signed; };