title: How to convert typename T to string in c++
body: <p>While playing with templates in c++ I encountered a problem converting typename T to string. For example:</p>
  
  <pre><code>template &lt;typename T&gt;
  class Matrix {
     public:
          Matrix() {
             //my_type = string type of T. i.e. if T is char. I want my_type to be "char".
          }
     string my_type;
  }
  </code></pre>
  
  <p>How do I convert T to a string that says what T is.</p>
  
  <p>Note: I'm just playing around so please do not worry about when one might need such a thing.</p>