title: c++ forcing operator == overload from interface abstract class
body: <p>using an interface (abstract class) on c++ i have the need to force any class than inherits the interface to implement the operator ==.
  consider this situation:</p>
  
  <pre><code>class IBase
  {
     virtual void someFunc() const = 0; 
  }
  
  class CInheritClass : public IBase
  {
     virtual void someFunc() const; 
     virtual bool operator== ( const CInheritClass&amp; obj ) const;
  }
  
  void main()
  {
    CInheritClass instance;
  }
  </code></pre>
  
  <p>class CInheritClass must implement someFunc since it inherits Ibase, implementing <code>virtual bool operator== ( const CInheritClass&amp; obj ) const;</code> is not mandatory.
  i would like to modify IBase class in a way that any inheritor X will have to implement</p>
  
  <pre><code>virtual bool operator== ( const X&amp; obj ) const
  </code></pre>
  
  <p>the following code will works:</p>
  
  <pre><code>template&lt;class X&gt;
  class IBase
  {
     virtual void someFunc() const = 0; 
     virtual bool operator== ( const X&amp; obj ) const = 0;
  
  }
  
  class CInheritClass : public IBase&lt;CInheritClass&gt;
  {
     virtual void someFunc() const; 
     virtual bool operator== ( const CInheritClass&amp; obj ) const;
  }
  </code></pre>
  
  <p>but i am after a solution that does not use templates cause every class that wishes to implement IBase must inherit IBase with itself as the template class <code>class X : public IBase&lt;X&gt;</code> and that is confusing and unclear to any future developer that might have a look on my code.
  any idea ?</p>