title: Something I misunderstand with c++ pure virtual function and interfaces
body: <p>I like to have well defined interface in a few classes, for this I created pure virtual functions in an abstract class that each class needs to implement.<br>
  But I'm facing the problem that I can instantiate the classes so I have to create another class that inherit the interface class, and all the other classes needs to inherit from this base class. Here is the code for example:</p>
  
  <h2>The interface</h2>
  
  <pre><code>class Interface
  {
       virtual std::string getName() = 0;
  }
  
  class Base : public Interface
  {
     virtual std::string getName(return std::string("Base") ;)
  }
  
  class A : public Base
  {
    std::string getName(return std::string("A") ;)
  
  }
  
  class B : public Base
  {
    std::string getName(return std::string("B") ;)
  
  }
  </code></pre>
  
  <p>All this so i could in code to have the same type for A &amp; B.<br>
  Can I just use the <code>Interface</code> class without the <code>Base</code> class?<br>
  Something like this:</p>
  
  <pre><code>class A : public Interface
  {
    std::string getName(return std::string("A") ;)
  
  }
  </code></pre>