title: How to write Template class copy constructor
body: <p>How to write copy constructor for a template class. So that if the template parameter is another user defined class it's copy constructor is also get called.</p>
  
  <p>Following is my class</p>
  
  <pre><code>template &lt;typename _TyV&gt;
  class Vertex {
  public:
      Vertex(_TyV in) :   m_Label(in){ }
      ~Vertex() { }
      bool operator &lt; ( const Vertex &amp; right) const {
          return m_Label &lt; right.m_Label;
      }
  
      bool operator == ( const Vertex &amp; right ) const {
          return m_Label == right.m_Label;
      }
  
      friend std::ostream&amp; operator &lt;&lt; (std::ostream&amp; os, const Vertex&amp; vertex) {
          return os &lt;&lt; vertex.m_Label;    
      }
  
      _TyV getLabel() { return m_Label;}
  private:
      _TyV m_Label;
  public:
      VertexColor m_Color;
  protected:
  };
  </code></pre>