title: Getting type from template value, C++
body: <p>I have the following method in which I'm using boost::variant. I try to get the value, based on type <code>T</code>. If <code>boost::get&lt;T&gt;</code> fails I want to handle that in a special way if T is an int or unsigned int. Is there any way to know if <code>T</code> is an int or unsigned int?</p>
  
  <p>I don't think I can use template specialization in this case, can I?</p>
  
  <p>EDIT: Also, I don't yet have access to C++11 (soon I hope)</p>
  
  <pre><code>template &lt; typename T, typename C, void (C::*setterFcn)(const T&amp;) &gt;
  void binder( const Variant&amp; value_var, C* c )
  {
      const T* typeData = boost::get&lt;T&gt;(&amp;value_var);
  
      if ( NULL == typeData )
      {
          // Need to check for int or unsigned int here somehow
      }
  
      (((C*) c)-&gt;*(setterFcn))(*typeData);
  }
  </code></pre>