title: Extract C++ template parameters
body: <p>Although I'm doubtful, I'm curious as to whether it's possible to extract primitive-type template parameters from an existing type, perhaps using RTTI.</p>
  
  <p>For example:</p>
  
  <pre><code>typedef std::bitset&lt;16&gt; WordSet;
  </code></pre>
  
  <p>Would it be possible to extract the number 16 in the above code without hard-coding it elsewhere? Compiler specific implementations are welcome, though I'm particularly interested in <code>g++</code>.</p>