title: How to inherit from Template class C++
body: <p>Its been a while for C++, I have a class Number and several subclasses like Integer, Decimal.. I would like to override == operator to compare when two nums are numerically equal... I have something like the following, but can't seem to figure out the syntax for subclass inheriting from template class as well as syntax for overriding == operator in subclass...</p>
  
  <pre><code>template class &lt;T&gt;
  class Number{
    T data;
     Number(T num) { data = num ;}
    boolean operator==(T &amp;other){ return data == other; }
   }
  
  class Integer : public Number{
   int iData;
   Integer(int i) { iData = i ; }
   boolean operator==(Integer &amp;other){ return idata == other.iData; }
  
   }
  </code></pre>