title: What is this C++ code attempting to achieve?
body: <p>I'm studying the DTMF code at <a href="http://sourceforge.net/projects/dtmf/" rel="nofollow">http://sourceforge.net/projects/dtmf/</a>.  I've come across some C++ code that I'm having trouble understanding:</p>
  
  <pre><code>template&lt;int, int, int, int&gt; class Types;
  template &lt;&gt; class Types&lt;5, 4, 2, 1&gt;
  {
  public:
          typedef long int Int40;
          typedef unsigned long int Uint40;
          typedef int Int32;
          typedef unsigned int Uint32;
          typedef short int Int16;
          typedef unsigned short int Uint16;
          typedef char Int8;
          typedef unsigned char Uint8;
  };
  template &lt;&gt; class Types&lt;8, 4, 2, 1&gt;
  {
  public:
          typedef long int Int64;
          typedef unsigned long int Uint64;
          typedef int Int32;
          typedef unsigned int Uint32;
          typedef short int Int16;
          typedef unsigned short int Uint16;
          typedef char Int8;
          typedef unsigned char Uint8;
  };
  template &lt;&gt; class Types&lt;4, 4, 2, 1&gt;
  {
  public:
          typedef int Int32;
          typedef unsigned int Uint32;
          typedef short int Int16;
          typedef unsigned short int Uint16;
          typedef char Int8;
          typedef unsigned char Uint8;
  };
  
  // For 16bit chars
  template &lt;&gt; class Types&lt;2, 1, 1, 1&gt;
  {
  public:
          typedef long int Int32;
          typedef unsigned long int Uint32;
          typedef short int Int16;
          typedef unsigned short int Uint16;
  };
  
  typedef Types&lt;sizeof(long int), sizeof(int), sizeof(short int), sizeof(char)&gt;::Int32     INT32;
  typedef Types&lt;sizeof(long int), sizeof(int), sizeof(short int), sizeof(char)&gt;::Uint32    UINT32;
  typedef Types&lt;sizeof(long int), sizeof(int), sizeof(short int), sizeof(char)&gt;::Int16     INT16;
  typedef Types&lt;sizeof(long int), sizeof(int), sizeof(short int), sizeof(char)&gt;::Uint16    UINT16;
  </code></pre>
  
  <p>From there, they are used just like normal primitive types:</p>
  
  <pre><code>static const INT16 tempCoeff[8];
  </code></pre>
  
  <p>My gut feeling tells me that all this stuff achieves some sort of cross-platform portability.  Am I right, or is there more to it?</p>