Interfaces in c++
<p>I would like to use interfaces in c++ like in java or in c#. I decided to use purely abstract classes with multiple inheritance, but something is terribly wrong when I specialize the interface:</p>

<pre><code>class Interface
{
public:
  virtual int method() = 0;
};

// Default implementation.
class Base: virtual public Interface
{
public:
  virtual int method() {return 27;}
};

// specialized interface
class Interface2: public Interface
{
public:
  virtual int method() = 0;
// some other methods here
};


// concrete class - not specialised - OK
class Class: public virtual Interface, public virtual Base
{
};

// concrete class - specialised
class Class2: public Interface2, public Base
{
};



int main()
{
  Class c;
  Class2 c2;
return 0;
}
</code></pre>

<p>Warning 1 warning C4250: 'Class' : inherits 'Base::Base::method' via dominance 30 </p>

<p>Error   2 error C2259: 'Class2' : cannot instantiate abstract class 42 </p>

<p>What is the proper way to do this?</p>
