title: C++ How do compilers handle templates
body: <p>As some of you may know from my recent posts i am studying for a C++ exam which the content for the class was delivered very poorly. I am basically having to self teach everything myself so bear with me here.</p>
  
  <p>This is an exam question:</p>
  
  <blockquote>
    <p>(i)Explain the concepts of templates as defined in the C++ language.
    Be sure to differentiate between what the programmer does and what the
    compiler does.</p>
  </blockquote>
  
  <p>My current rationale:</p>
  
  <p>(i) A template allows a function or class to operate using generics. This allows the programmer to effective program X functionality once, and be able to use this functionality with many different data types without having to rewrite the application or parts of the application multiple times.</p>
  
  <p>My problem is i have no idea how the compiler handles the use of templates.</p>
  
  <p>I am unsure what the compiler does at this stage, if somebody could clear this up it would be helpful.</p>