title: Why can templates only be implemented in the header file?
body: <p>Quote from <a href="http://books.google.com/books?id=n9VEG2Gp5pkC&amp;pg=PA10&amp;lpg=PA10&amp;dq=%22The%20only%20portable%20way%20of%20using%20templates%20at%20the%20moment%20is%20to%20implement%20them%20in%20header%20files%20by%20using%20inline%20functions.%22&amp;source=bl&amp;ots=Ref8pl8dPX&amp;sig=t4K5gvxtBblpcujNxodpwMfei8I&amp;hl=en&amp;ei=qkR6TvbiGojE0AHq4IzqAg&amp;sa=X&amp;oi=book_result&amp;ct=result&amp;resnum=3&amp;ved=0CC8Q6AEwAg#v=onepage&amp;q=%22The%20only%20portable%20way%20of%20using%20templates%20at%20the%20moment%20is%20to%20implement%20them%20in%20header%20files%20by%20using%20inline%20functions.%22&amp;f=false" rel="noreferrer">The C++ standard library: a tutorial and handbook</a>:</p>
  
  <blockquote>
    <p>The only portable way of using templates at the moment is to implement them in header files by using inline functions.</p>
  </blockquote>
  
  <p>Why is this?</p>
  
  <p>(Clarification: header files are not the <em>only</em> portable solution. But they are the most convenient portable solution.)</p>