title: C++ cannot instantiate abstract class
body: <p>I am new to C++. Could you pls help me get rid of the errors:</p>
  
  <p>error C2259: 'MinHeap' : cannot instantiate abstract class</p>
  
  <p>IntelliSense: return type is not identical to nor covariant with return type "const int &amp;" of overridden virtual function function</p>
  
  <pre><code>template &lt;class T&gt; class DataStructure { 
      public:
          virtual ~DataStructure () {}
  
          virtual bool IsEmpty () const = 0;    
  
          virtual void Push(const T&amp;) = 0;
  
          virtual const T&amp; Top() const = 0;
  
          virtual void Pop () = 0;
  };
  
  class MinHeap : public DataStructure&lt;int&gt;
  {
      private:
          std::vector&lt;int&gt; A;       
  
      public:
          bool IsEmpty() const
          {
              ..
          }
  
          int Top() const
          {
             ..         
          }
  
          void Push(int item)
          {
              ...
          }
  
          void Pop()
          {
              ..
          }   
  };
  </code></pre>