title: Do c++ templates make programs slow?
body: <p>I have heard from many people that usage of templates make the code slow. Is it really true. I'm currently building a library. There are places where if templates are not created, it would result in code management problem. As of now I can think two solutions to this problem:</p>
  
  <ul>
  <li><p>use #defines </p></li>
  <li><p>Use templates and define all possible types in the header file/library itself but do not allow end user to make template instances.</p></li>
  </ul>
  
  <p>e.g. <code>typedef Graph&lt;int&gt; GraphI32;</code> etc. </p>
  
  <p>Is there anyway, to restrict user from creating various template instances on their own.</p>
  
  <p>Help on above queries would be highly regarded.</p>