title: C++ templates declare in .h, define in .hpp
body: <p>I saw some code in which the developer defined a class template in a .h file, and defined its methods in a .hpp file. This caught me a bit by surprise.</p>
  
  <p>Are there are particular conventions in C++ when dealing with templates and what files they should be in? </p>
  
  <p>For example say I had a <code>Vector</code> class template with methods for vector operations (add, subtract, dot, etc.). I would also want to specialize certain functions if the template argument is a <code>float</code> (comparison operators). How would you separate all of this between files (specify whether .h, .hpp, .cpp).</p>