title: Using typeid to check for template type
body: <p>I would like to know if doing the following is safe:</p>
  
  <pre><code>template&lt;class T&gt;
  void Parameters::add(Parameter&lt;T&gt; p)
  {
     std::string sprobe("");
     int iprobe = 0;
     double dprobe = 0.;
  
     if (typeid(T) == typeid(sprobe))
       this-&gt;mstrings[p.name()] = p;
  
     if (typeid(T) == typeid(iprobe))
       this-&gt;mints[p.name()] = p;
  
     if (typeid(T) == typeid(dprobe))
       this-&gt;mdoubles[p.name()] = p;
  }
  </code></pre>
  
  <p>I have a Class for storing parameters. It has 3 boost::unordered_map member variables for storing parameters of type int, double and std::string;</p>
  
  <p>I created a template class Parameter.</p>
  
  <p>I understand that if my Parameter is not one of the 3 types that I anticipated this will fail. But it is not a problem since I know that the Parameters can only be of these types.</p>
  
  <p>Thanks for your help </p>