title: Determination of type in function template
body: <p>I would like to ask you for an advice about function template. I have a function that adds some data into buffer. But I need also to add an information about data type into the buffer. The type of data is a following enum:</p>
  
  <pre><code>enum ParameterType
  {
     UINT,
     FLOAT,
     DOUBLE
  };
  </code></pre>
  
  <p>And I need to create a function template from function like this:</p>
  
  <pre><code>void SomeBuffer::append( double par )
  {
      appendType( DOUBLE );
      memcpy( pStr + _length, &amp;par, sizeof( double ) );
      _length += sizeof( double );
      appendType( DOUBLE );
  }
  </code></pre>
  
  <p>Could you please advice me how to pass a value from ParameterType for appendType() depending on type of parameter.</p>
  
  <pre><code>template&lt;class T&gt;
  void SomeBuffer::append( T par )
  {    
      appendType( ??? );
      memcpy( pStr + _length, &amp;par, sizeof( T ) );
      _length += sizeof( T );
      appendType( ??? );
  }
  </code></pre>
  
  <p>I tried to do it by some macros but without success. Thank you very much for any advice.</p>