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!

Qt Code:
  1. template <int> struct QIntegerForSize;
  2. template <> struct QIntegerForSize<1> { typedef quint8 Unsigned; typedef qint8 Signed; };
  3. template <> struct QIntegerForSize<2> { typedef quint16 Unsigned; typedef qint16 Signed; };
  4. template <> struct QIntegerForSize<4> { typedef quint32 Unsigned; typedef qint32 Signed; };
  5. template <> struct QIntegerForSize<8> { typedef quint64 Unsigned; typedef qint64 Signed; };
To copy to clipboard, switch view to plain text mode